[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating Error Estimates

David Fanning wrote:

> Hi Folks,
> It is so hot in Colorado today that I think my brain has
> vapor locked. In any case, I can use some help. :-)
> Here is my problem. I have some experimental data. I
> have used CURVEFIT and my roll-your-own function to
> fit a curve through the data. What I want to do is
> display the experimental data on the plot, along with
> the curve. But I want to place error bars through
> the experimental data points. My question is this:
> how do I calculate the errors for the individual
> points so that I can place them on the plot with
> CURVEFIT returns to me a parameter called SIGMA,
> which contains the standard deviations of the returned
> values of the four coefficients in my fitting
> function. What I cannot seem to work out is how
> to use these standard deviations to obtain an
> error estimate for each individual experimental
> point.
> I realize this is basic error analysis, but even
> an hour spent refreshing myself with Bevington
> has not successfully stimulated this reptilian brain. :-(
> Let's just say I had too much fun on vacation...
> Thanks,
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> E-Mail: davidf@dfanning.com
> Phone: 970-221-0438
> Coyote's Guide to IDL Programming: http://www.dfanning.com/

Hi David,

I think you can not obtain error estimates for your data points from
your fit.

The errors of your data points depend on your measurement, i.e. they
have nothing to do with your fit.
For example, when you count different possible events, where you expect
e.g. a gaussian distribution, your data point error is - in first order
- the statistical error, and can be calculated just with:
sigma_y = SQRT(y)
(This is correct only for large values of y, for small values of y you
have to use Poisson-statistics).
Of course you have to take into account all your error sources,
depending on the experimental setup.
But i normally use the above stated SQRT(y), the statisitcal error, for
the errorbars.

For a proper fit, e.g. with CURVEFIT, you need this errors to calculate
the weight w of each datapoint.
There i use w = (1.0 / sigma_y^2.0) .

The standard deviations "sigma_a" for the different parameters in the
fit are important for the goodness of your fit (-> chisquared), but
completely differ from the data point errors.

By the way, for every  user who works with CURVEFIT: The standard
deviations, calculated in the routine, are not correct, at least not in
any sense known to me.
As i posted some time ago, we have a modified CURVEFIT routine which
works proper and also you are  able to constrain parameters at your own

I hope, i could help you, David,


Heiko Hünnefeld


 Notkestr. 85
 22603 Hamburg
 Tel.: 040 / 8998-2698
 Fax.: 040 / 8998-2787
e-mail: hhuenne@desy.de