Hi Scott,
On Sat, Jan 7, 2012 at 12:42 PM, Scott Calvin
Hi all,
Is there a way to get Athena (or Ifeffit) to report an R-factor for a linear combination sum, as opposed to a fit? Artemis does that for FEFF fitting, and Athena will do a linear combination sum ("plot data + sum" with weights entered into the LCF standards boxes), but I don't see a way to get it to report the statistics.
Here's the reason I'd like to be able to do this: when I run LCF fits, I often do one fit for XANES and another on chi(k) for EXAFS (and perhaps another using the derivative of XANES, just for good measure). The fits unsurprisingly usually give somewhat different weights to each fraction. So suppose XANES tells me my sample is 0.22 A and 0.78 B, and EXAFS tells me its 0.28 A and 0.72 B. I'd like to be able to force the EXAFS to 0.22 A and 0.78 B (i.e. the results of the XANES fit), and have it give me an R-factor for that sum. Then I could apply something like a Hamilton test to decide if they're actually consistent.
If it's not currently a feature, it's one I'd like to see. It's not that high a priority--I can just export the spectra and calculate it in Excel. But it would be nice.
It should be possible to calculate an R-factor or chi-square statistics with a fairly simple ifeffit macro, using the functions vsum() (to sum an array) and npts(). Something like (untested, top-of-my-head): macro show_rfact my.data my.model _fit.d = $1 - $2 mean = vsum(_fit.d)/npts(_fit.d) variance = vsum(_fit.d**2)/npts(_fit.d) - mean*mean stderr = sqrt(variance) rfact = vsum(_fit.d**2) / vsum($1**2) print ' statistics for fit:' print ' mean +/- standard_error = ', mean, ' +/-', stderr print ' rfactor = ' rfact end macro Hope that helps.... --Matt