Currently, I am doing a lab in school on atomic spectroscopy. After taking readings of strong emission lines of various elements, I have fit the data using a Voigt Profile function from lmfit. The function minimizes the reduced chi-squared and returns the best fit along with fitting parameter values (center, amplitude, sigma, gamma). I am mainly interested in the center of the line profile. But, what is the uncertainty in this reported center? Or how would I report the measurement and its uncertainty.

  • $\begingroup$ This is really a question about statistics and not astronomy or even physics. $\endgroup$ Commented Dec 2, 2019 at 15:01
  • $\begingroup$ I'm voting to close this question as off-topic because it's a statistics question $\endgroup$ Commented Dec 2, 2019 at 15:02
  • $\begingroup$ @CarlWitthoft we can vote to close a question here if it is off-topic in this site, but "because it's an X question" or "is better asked elsewhere" are not good close reason. OP decides where they would like to ask it. However I'm sure that the OP would get an excellent answer in Cross Validated SE though they might be tougher on the question as written. $\endgroup$
    – uhoh
    Commented Dec 3, 2019 at 2:20
  • $\begingroup$ @ahayes24 have you looked at the out.fit_report() method shown in your linked documentation? Search for "+/-" I think that's what you are looking for. However, I am not sure that's the whole story because when strong correlations are present (those are also included in the fit_report) then a poor fit may have worse uncertainties than the +/- might suggest. Now that's a question for Cross Validated SE! $\endgroup$
    – uhoh
    Commented Dec 3, 2019 at 2:25
  • $\begingroup$ @CarlWitthoft Apologies for writing this question here. I assumed Astronomy had a lot of experience in spectral line fitting so I thought I would try it here. I can move it to the Cross Validated SE section and make my question clearer. $\endgroup$
    – ahayes24
    Commented Dec 5, 2019 at 0:03

1 Answer 1


If you are doing chi-squared fitting, then a value for the uncertainty (or an estimate) should have been returned by the software. If not, you could perhaps manually estimate by fixing the line centre at various values, allowing the other parameters to be fitted, and seeing where the minimum chi-squared increases by 1 over the global minimum.

Failing that, output your spectrum as an ASCII file and fit it with something that does provide uncertainties like gnuplot.

Failing that, here's a rule of thumb. The line centre is determined with a precision given by the FWHM divided by the signal to noise ratio per pixel.

Note that none of the above take any account of uncertainties in the wavelength calibration.

EDIT: It appears that lmfit does estimate uncertainties. https://lmfit.github.io/lmfit-py/confidence.html

  • $\begingroup$ I would add that the OP should take the time to learn in detail what the particular python tool he's using does, how it does it, and why. I might start by telling him to use scipy because it's a more reliable (vetted, reviewed) package than some random GitHub tool. $\endgroup$ Commented Dec 2, 2019 at 15:03
  • $\begingroup$ I left this comment in review before seeing your answer. I know that strong correlations are "bad" and can cause problems especially when the quality of the fit is poor, but I don't know how to articulate that accurately. $\endgroup$
    – uhoh
    Commented Dec 3, 2019 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .