Curve Fitting

Cory K
Posts: 17
Joined: 2008-08-22
Location: United States

I am trying to fit a data curve so I can find peak values.
I was told by a colleague to fit the data to an "80% Gaussian, 20%Laurenzian" fit.
So far, I am able to fit something to a guassian fit, and to a laurenzian fit, but not a mix of the two.
First of all, is that even mathmatically possible? If so, how do you do it on Igor?


Cory K
Posts: 17
Joined: 2008-08-22
Location: United States

OK, well I think I figured out my first question.
Yes, it is mathmatically feasable, I was misinterpreting the sentance.

What they meant was the following:
y = y value
G(x) = function of Gaussian curve
L(x) = function of Laurenzian curve

I think I need to fit the data to:
y = 0.8*G(x) + 0.2*L(x)

could someone tell me how to do this?


andyfaff
Posts: 56
Joined: 2007-09-12
Location: Australia

Check out the Multipeakfitting package that comes with the Igor6.1 Beta. (Analysis->Packages->Multipeakfit).


Cory K
Posts: 17
Joined: 2008-08-22
Location: United States

There is only 1 peak per graph,
I would like something more along the lines of "multifunction fitting" if that exists somewhere


Cory K
Posts: 17
Joined: 2008-08-22
Location: United States

OK, well I answered my second question.
I created a new fit called GaussLorMix:

f(x) = 0.8*(y0 + A*exp(-((x-x0)/width)^2)) + 0.2*(y0 + A/((x-x0)^2 + B))

where:
Independent variable = x

Dependent variables:
x0
y0
A
B
width

However, since it is a custom fit, I must provide initial guesses for each of the values.
If I were to provide guesses, they would be exactly that.... guesses

Any advice?


Posts: 82
Joined: 2007-06-21
Location: United States

You can manually try out your guesses using the Graph Now button in the Coefficients tab of the Curve Fitting dialog. For details, execute this and read down through the section that mentions Graph Now:

DisplayHelpTopic "Fitting to a User-Defined Function"


Posts: 86
Joined: 2007-06-29
Location: United States

Cory K wrote:
OK, well I think I figured out my first question.
Yes, it is mathmatically feasable, I was misinterpreting the sentance.

What they meant was the following:
y = y value
G(x) = function of Gaussian curve
L(x) = function of Laurenzian curve

I think I need to fit the data to:
y = 0.8*G(x) + 0.2*L(x)

could someone tell me how to do this?

You might want to check if your colleague meant that you should fit with a Voigt peak shape, which is a convolution of a Lorenzian peak with a Gaussian peak. The 80/20 split would be a shape parameter of 4, where the shape parameter is the ratio of the Lorenzian width to the Gaussian width.

Igor ships with an XOP called the MultiPeakFit xop that implements a Voigt peak function.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


Posts: 86
Joined: 2007-06-29
Location: United States

Cory K wrote:
OK, well I answered my second question.
I created a new fit called GaussLorMix:

f(x) = 0.8*(y0 + A*exp(-((x-x0)/width)^2)) + 0.2*(y0 + A/((x-x0)^2 + B))

where:
Independent variable = x

Dependent variables:
x0
y0
A
B
width

However, since it is a custom fit, I must provide initial guesses for each of the values.
If I were to provide guesses, they would be exactly that.... guesses

Any advice?

1) the Y0 parameter should appear only once, outside the sum. The way you've written it won't cause a problem, but it's inefficient.

2) You need the widths of the Gaussian and Lorenzian peaks to be the same, presumably. So you need to use just the B parameter (full width at half max of the Lorenzian) and set width = 2*sqrt(ln(2))*B. I think I have that right...

3) You could use the built-in Lor fit, then use the parameters from that fit as the initial guess for your combined fit.

4) Oh, yeah- you can also take the A outside the sum. So the final equation will be something like

Variable gwidth = 1.6651092223154*B
f(x) = y0 + A*(0.8*exp(-((x-x0)/gwidth)^2) + 0.2*(y0 + A/((x-x0)^2 + B)))

Where the fit parameters are y0, A and B.

By the way, there is just one dependent variable here; it is the result of evaluating the equation. The things called y0, A and B are "fit coefficients". X is the independent variable.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


[ last edited September 18, 2008 - 17:09 ]
Cory K
Posts: 17
Joined: 2008-08-22
Location: United States

Thanks,
I'll give that a shot


Back to top