[Ifeffit] Determining errors in R_fit

Matt Newville newville at cars.uchicago.edu
Sat Nov 17 12:02:33 CST 2012


Hi Jatin, Jason, All,

On Fri, Nov 16, 2012 at 12:49 PM, Jason Gaudet <jason.r.gaudet at gmail.com> wrote:
> Since R_eff is constant, surely all you need to do is multiply R_eff by the
> uncertainty in alpha?  That will be the uncertainty in delta_R and R_fit.
>
> The program is only giving you statistically-derived uncertainty for the
> values it fits; the user needs to determine how to propagate or otherwise
> deal with this uncertainty.

As Jason points out, propagating the uncertainty from  the variable
alpha delta_R = alpha * Reff is straightforward, as

   delta_R_stderr = alpha_stderr * Reff

Ifeffit does not do this calculation for you.   For more complicated
expressions of variables, the error propagation can be more involved.
For un-correlated variables the math is generally tractable.
Including correlations can become complicated.

I've been trying hard to not make the following comment about every
question that comes up on the mailing list, but this is one case where
I can't resist.

The propagation of errors is much, much better with Larch than
Ifeffit, and I would highly encourage anyone interested to try out
larch:
    http://xraypy.github.com/xraylarch/

At this point, the main interface for Larch is a command-line / batch
processing program.  Sadly, I don't yet have a windows installer for
this yet, but hope to have one available soon.  Feedback, suggestions,
and collaborations would be greatly appreciated and no doubt lead to
better analysis.

In more detail, for constraint expressions such as "delta_R = alpha *
reff", Larch does propagate and report uncertainties for all Path
Parameters as well as fitted variables and constraints  ("Def"
expression in Ifeffit).   The propagated uncertainties include the
correlation of variables.  Currently, the propagation only works for
algebraic expressions with operators (+, -, *, /, **), but not when
calling functions (even built-in mathematical functions like sin() and
sqrt()).   That is, for variables 'alpha', 'beta', and 'gamma', errors
will be correct for  "alpha * constant", "alpha * beta + gamma",
"alpha ** 2", and so forth, but  "sqrt(beta)" will currently (bug
fixed in the past hour!) and the uncertainty will be set to 0.    I
think I understand the issue,  have been in contact with the author of
the underlying error propagation library about this,  and believe this
will be fixable.

Anyway, that's all to say that this is yet another reason to start
investing in trying out using Larch instead of Ifeffit.

--Matt



More information about the Ifeffit mailing list