Program to fit data to normal distribution function
|
11-12-2023, 07:37 PM
(This post was last modified: 11-13-2023 08:41 AM by rawi.)
Post: #1
|
|||
|
|||
Program to fit data to normal distribution function
Program to fit data to normal distribution function.
a) Application: 1. Set calculator in User-Mode. 2. XEQ NFIT (Start of program, deleting all registers and stack, setting statistics registers to Reg05) 3. Put in data: For every data point: X ENTER Y A -> Number of data points so far is shown. Correction of last data point: B 4. Compute results: C. Parameters a, b, c, R² are shown. Show results again: D Whereas a, b, c are the parameters of the following function: Y = a*EXP[(X-b)²/c] and R² is the coefficient of determination. 5. Compute estimate of Y for given X: E -> X? -> Put in given X-value R/S -> Estimated Y Ye b) Example: Data of heights of a group of persons and frequency: Height (X) Frequency in % (Y) 53 6.25 54 6.25 55 6.25 56 12.5 57 18.75 58 18.75 59 12.5 60 12.5 62 6.25 USR XEQ Alpha NFIT Alpha Data Input: 53 ENTER 6.25 A -> 1 54 ENTER 6.25 A -> 2 55 ENTER 6.75 A -> 3 (Error) B -> 2 (The last data point is deleted) 55 ENTER 6.25 A -> 3 (Correct input) 56 ENTER 12.5 A -> 4 57 ENTER 18.75 A ->5 … 62 ENTER 6.25 ->9 Computation: C -> a=15.0203 -> R/S -> b=57.8945 -> R/S -> c=-20.586 – R/S -> R2=0.7477 Fitted normal distribution is Y = a*EXP[(X-b)²/c] The parameters a, b, c, R² are stored in registers 01, 02, 03, 04. Results are shown again by pressing D. Estimate Y for X=61: E -> X? 61 R/S -> Ye= 9.4020 (Estimate for Y) c) Registers used: 01 – 21 01 a / ln Y a=EXP(R21-R20²/4/R19) 02 b / X b=-R20/2/R19 03 c c=1/R19 04 R² R²=(R21*R07+R20*R09+R19*R13-R07²/R10)/(R08-R07²/R10) 05 ∑Xi 06 ∑Xi² 07 ∑ln(Yi) 08 ∑(ln(Yi))² 09 ∑Xi * ln(Yi) 10 n 11 ∑Xi^3 12 ∑Xi^4 13 ∑Xi² * ln(Yi) 14 R06*R10-R05² 15 R10*R13-R06*R07 16 R10*R11-R05*R06 17 R10*R09-R05*R07 18 R10*R12-R06² 19 (R14*R15-R16*R17)/(R14*R18-R16²) 20 (R17-R16*R19)/R14 21 (R07-R20*R05-R19*R06)/R10 d) Program listing (256 Bytes): Code: 01 LBL "NFIT" f) Link to RAW-file https://www.dropbox.com/scl/fo/ri5v9o43r...7b5w9&dl=0 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Program to fit data to normal distribution function - rawi - 11-12-2023 07:37 PM
RE: Program to fit data to normal distribution function - Namir - 11-12-2023, 11:04 PM
RE: Program to fit data to normal distribution function - rawi - 11-13-2023, 05:30 AM
RE: Program to fit data to normal distribution function - rprosperi - 11-13-2023, 12:37 PM
RE: Program to fit data to normal distribution function - Namir - 11-13-2023, 06:19 AM
RE: Program to fit data to normal distribution function - rawi - 11-13-2023, 08:01 AM
RE: Program to fit data to normal distribution function - Namir - 11-13-2023, 08:22 PM
|
User(s) browsing this thread: 1 Guest(s)