longingfriday
longingfriday

Reputation: 21

How to calculate error in amplitude and standard deviation for Gaussian fitting?

Gaussian fit with data which has xerrors

I have data that has xerrors and I am fitting a gaussian curve to it using scipy.optimize.curve.fit. I want to calculate the errors in amplitude and standard deviation of my fit, using the xerrors given. The sigma parameter mentioned in SciPy curvefit docs takes the yerrors. It would be helpful if I can accommodate the xerrors to the error of gaussian parameters.

Thank you!

Upvotes: 2

Views: 571

Answers (1)

ev-br
ev-br

Reputation: 26030

Curve_fit does not accept x errors. The simplest thing to do here is likely to generate synthetic datasets (each x point point is a gaussian with a given mean and standard deviation), fit them and analyze the statistics of the fit results.

Upvotes: 0

Related Questions