I want to extract the position of a peak from a spectrum (energy spectrum of scattered photons). To do so, I am using scipy.optimize.curve_fit to fit a Gaussian to the region of the spectrum that resembles the Gaussian.
How do I find the uncertainty of the peak value? The peak value itself will be given by the result for the mean parameter from the Gaussian regression.
There are two things that came to my mind:
- I get covariance values from the minimisation routine from which I get the error on the mean parameter.
- Also, I could think about using the sigma of the Gaussian to get to the error of the mean.
My thoughts on this would be, that the error on the mean parameter cannot be the wrong way to go. And I would also wager that the standard error does not really tell us the uncertainty with which we know the peak value. It tells us about the shape of the distribution but not about the uncertainty in the peak value (which, for simplicity, we believe to have a true, sharply defined value.)
(This is a repost of a question I originally posted on stats.stackoverflow where I did not get any answers after 2 days.)