Make it more visible that amplitude is equal to peak area

145 views
Skip to first unread message

Matthias Arras

unread,
Nov 4, 2019, 11:06:05 AM11/4/19
to lmfit-py
Hi,

lmfit is an amazing package! Thanks a lot.

I think many people will use it to fit peaks, and will likely be interested in the area under the peak. 
If I am not totally mistaken, since lmfit peak-functions seem to be implemented in the normalized version (meaning the integral will equate to 1 for A=1), amplitude A is equal to area. 
At least, I checked that this true for GaussianModel() and VoigtModel().

I think it would be useful to point this fact out in the manual, or even better in the params() table. Potentially one would introduce a new column 'comments'. 

Thanks
Matthias

Matt Newville

unread,
Nov 4, 2019, 3:19:38 PM11/4/19
to lmfit-py
Hi Matthias,
Yes, it is true that most (possibly all) of the peak-like functions are unit-normalized (or as close to unit-normalized as we know how to do) which means that `amplitude` will be the area under that peak, or the strength of that peak intensity, independent of the peak width or center.  This does seem to be a common source of confusion. It's partly why we also report the "height" derived parameter -- the estimated value of the maximum intensity value in the distribution function. 

I think I would be reluctant to put "Note: Amplitude is Area" in the fit report (hopefully, one needs to be told this only a few times ;)), but there could be a more prominent note in the documentation for the Peak-like functions.  A Pull Request on adding that to the docs would be most welcome!
--Matt 

Vital Fernández

unread,
Aug 8, 2020, 7:53:40 PM8/8/20
to lmfit-py
How is the height reported? What is the right way to access its value and uncertainty from the fit output?

Matt Newville

unread,
Aug 8, 2020, 9:39:54 PM8/8/20
to lmfit-py
On Sat, Aug 8, 2020, 6:53 PM Vital Fernández <lati...@gmail.com> wrote:
How is the height reported? What is the right way to access its value and uncertainty from the fit output?


Read the docs and examples.  If you have a question about your code, post your code and the output you get.  

Reply all
Reply to author
Forward
0 new messages