Hi, I would like to use the minimize function to fit a line to some data points. I could not find documentation on the r-square factor that is referred to as the confidence level for the fit. Thanks Shelly
On Tue, 28 Jan 2003, "Kelly, Shelly D."
said:
SDK> Hi, I would like to use the minimize function to fit a line to SDK> some data points. I could not find documentation on the SDK> r-square factor that is referred to as the confidence level for SDK> the fit. I was just browsing through `iff_minimize.f'. I am sure that Matt will correct me if I am wrong, but it seems as though no R-factor is evaluated by a call to minimize() in ifeffit. Chi-square is essentially the sum of squares of the function that you minimize (which, in your case, presumably, is the data minus the line). It and a reduced chi-square (normalized by the number of points in the minimization function minus the number of variables) are evaluated and stored as program variables, but there appears to be no R-factor that is stored. I just did a minimize and that seems to be the case, despite what it says in chapter 7 of the Ifeffit tutorial on Matt's website. If you were to make an R-factor that is the real-array equivalent of Ifeffit computes when fitting (imaginary) R-space EXAFS data, it would be something like: Npts [function(i) - data(i)]^2 R = sum ---------------------------- i=i data(i)^2 That would be a sort of positive-definate, percentage misfit and would be trivial to compute using ifeffit's array manipulation. HTH, B -- Bruce Ravel ----------------------------------- ravel@phys.washington.edu Code 6134, Building 3, Room 222 Naval Research Laboratory phone: (1) 202 767 5947 Washington DC 20375, USA fax: (1) 202 767 1697 NRL Synchrotron Radiation Consortium (NRL-SRC) Beamlines X11a, X11b, X23b, X24c, U4b National Synchrotron Light Source Brookhaven National Laboratory, Upton, NY 11973 My homepage: http://feff.phys.washington.edu/~ravel EXAFS software: http://feff.phys.washington.edu/~ravel/software/exafs/
Hi Shelly, Right now, minimize() doesn't report an r-factor, (does the doc say somewhere that an R-factor is reported?). minimize() does generate and report values for chi-square and reduced chi-square. chi-square = sum-of-squares < residual / uncertainty > where 'residual' is the array to minimize and 'uncertainty' is an array of uncertainties, one value for each point in the residual. If no uncertainty is given, the uncertainties are set to 1. reduced chi-square is simply reduced chi-square = chi-square / (npts(residual) - n_variables) minimize() is flexible enough that you could include the uncertainties in the definition of the function to minimize. It's also flexible enough to let you cheat, and scale chi-square anyway you want, for good or bad.... The reported uncertainties in the parameters follows the 'normal' rule of increasing chi-square by reduced-chi-square. An R-factor might be useful, I suppose .... --Matt On Tue, 28 Jan 2003, Kelly, Shelly D. wrote:
Hi,
I would like to use the minimize function to fit a line to some data points. I could not find documentation on the r-square factor that is referred to as the confidence level for the fit.
Thanks Shelly
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
participants (3)
-
Bruce Ravel
-
Kelly, Shelly D.
-
Matt Newville