
LogNormal Multipeak Fitting Asymmetric Data

I've been having trouble with the default log normal fitting function in both base igor pro 8 and the multipeak fitting package. Specifically, the regular fit will not skew, even though I have asymmetric spectroscopic data. I ended up programming my own log normal function that does allow for a skewed fit, and it does work. However, I've been unable to figure out how to get the data I want - area and peak maximum location - out of the multipeak fitting package. Additionally, the peaks aren't showing up in the individual peak section of the multipeak fitting graph, and when I try to put them in their own graph window, they don't look like a log-normal fit.
If someone can tell me either how to get the default multipeak lognormal fit function to fit asymmetric data, or how to get my function properly working with the multipeak fitting package, that would be very helpful. Thanks!
//This is the peak function - the actual fitting function Function MRGLogNormal(w, yw, xw) Wave w Wave yw, xw Variable l = w[0] Variable b = w[1] Variable h = w[2] Variable a = w[3] yw = (h/(xw*a*sqrt(2*pi)))*exp(-((ln(xw-l)-b)^2)/(2*a^2)) end


First, the lognormal function in multipeak fitting (MPF) is symmetric, so you cannot introduce a skew here. Also, I think upgrading to Igor 9 will make your life much easier, because the MPF package received a huge update. I have looked only briefly into your fit data. I can see where the issues are but I have a few questions:
June 3, 2025 at 02:06 pm - Permalink
I looked at your equations a bit more closely. I think a modified version would work:
With this your parameters a, b, h would actually be the width(?), position, height respectively. Such an equation could be implemented in Multipeak Fit and would give you a proper peak shape. I think it would also be possible to derive an analytical FWHM if you are good at calculus. Maybe even the already present equations of MPF can be reused if the equation is properly rescaled by l (w[3]) in the end.
June 3, 2025 at 08:43 pm - Permalink
Thanks very much for the help - I will definitely talk to my supervisor about upgrading to igor pro 9. The original log normal function I was using is actually a slightly modified version of the one from the help page for the multipeak function package - I've attached a screenshot below. According to that help file, I believe width = a * sqrt(2)
I do have one follow up question - I was able to implement your fitting function into multipeak fit as follows, but the peaks are still displaying incorrectly in the window, as well as when I open them in a new graph. Is there a way to fix this that I am overlooking?
June 4, 2025 at 07:05 am - Permalink
I think the remaining issue is that MPF expects a certain order of parameters. Rewrite your fit function to have the following order of parameters: 0 - position, 1 - width, 2 - height, 3 - other (shape in this case?. You can also share your code and I can have a look tomorrow.
June 4, 2025 at 07:26 am - Permalink
That was the issue - thanks again!
June 4, 2025 at 10:31 am - Permalink