Post Reply 
HP 42s Program Normal Distibution
10-23-2024, 04:41 AM
Post: #10
RE: HP 42s Program Normal Distibution
Thank you for your help with this code, Thomas. The program is now finalized and works on the DM42 to calculate the CDF of the Normal Distribution. By using the NCDF program (down below) in combination with the NPDF program (see below), you can calculate the CDF between two x-values. When running NCDF, it will prompt you to enter the mean, standard deviation, lower limit, and upper limit. The result offers an accuracy of approximately 10^-6. If you just want the PDF, then check out my last program pdf, it will ask you all the questions to find the PDF.

Code:

00 { 31-Byte Prgm }
01▸LBL "NPDF"
02 RCL "x"
03 RCL- "μ"
04 RCL÷ "s"
05 X↑2
06 -2
07 ÷
08 E↑X
09 RCL÷ "s"
10 2
11 PI
12 ×
13 SQRT
14 ÷
15 END

Code:

00 { 31-Byte Prgm }
01▸LBL "NPDF"
02 RCL "x"
03 RCL- "μ"
04 RCL÷ "s"
05 X↑2
06 -2
07 ÷
08 E↑X
09 RCL÷ "s"
10 2
11 PI
12 ×
13 SQRT
14 ÷
15 END

Code:

00 { 50-Byte Prgm }
01▸LBL "pdf"
02 MVAR "x"
03 MVAR "μ"
04 MVAR "s"
05 INPUT "x"
06 INPUT "μ"
07 INPUT "s"
08 RCL "x"
09 RCL- "μ"
10 RCL÷ "s"
11 X↑2
12 -2
13 ÷
14 E↑X
15 RCL÷ "s"
16 2
17 PI
18 ×
19 SQRT
20 ÷
21 END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 42s Program Normal Distibution - cylurian - 10-23-2024 04:41 AM



User(s) browsing this thread: 1 Guest(s)