Question: Write pseudocode to take a set of M(x,y) points, each with osso ciated errors, and return the best fit line, errors on parameters, and chiadf.




Write pseudocode to take a set of M(x,y) points, each with osso ciated errors, and return the best fit line, errors on parameters, and chiadf. Include any error checking that might be needed. Python ! We need to use 45 How to get best-fit parameters : ;9; . ()?- . - 344 ()2 - ? Just a few simple sums to calculate, pretty straightforward! 46 Is that the full picture? We also want to know three additional very important quantities The uncertainty on a 2) The uncertainty ontb Using point-by-point errors 491 And goodness of fit : x?(a, b)dof 2 n--]("-a-bri) If our data really follow a linear distribution AND we have estimated our errors correctly, we should get chi2dl values 1. Either way, we can use the chi2 and n to calculate a p-value indicating our goodness of fit 50 Other types of fits How do we fill other curves to our data ? One 48 Using point-by-point ers Uncertainties on parameters! S2 1 SS Su og io 7-1 with t; = S S 0 10 Yi S = ES SI = Sy those TO TO And goodness of fit : 2 Y; a bz; xla,b)dos ---- 49 Using point-by-point errors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
