Lecture slides     |     Basic equations     |      Text     |     Tools     |     Help
Non-linear Least Squares in Igor

Writing macros to define fitting functions

       
 
Set up in Igor
 

Igor has a menu-driven approach to setting up a calculation. There is a number of pre-defined functions including Gaussians and exponentials, which are two of the most common functions. However, combinations of more than one Gaussian or exponential are not standard and must be defined using a macro. We begin with the example of two Gaussians. Download and open the text file to see the structure of an Igor macro.

Two Gaussian fitting function in a Macro

You may put copy this macro and paste it into the Procedure Window in Igor. Then the function will appear in the fitting menu under Analysis/Curve fitting. These steps are demonstrated in the following segment.

Loading and setting up non-linear fitting functions PDF

Loading and setting up non-linear fitting functions

If you want to fit to the three Gaussians you need to write a macro or function that does this. One is provided here.

Three Gaussian fitting function in a Macro

Four Gaussians is also provided

Four Gaussian fitting function in a Macro

Another example that is not standard is a biexponential (two exponentials).

Biexponential fitting function in a Macro

Enzyme kinetics are fit using the Michaelis-Menten equation, which is provided in the following macro.

M-M fitting function in a Macro

Fitting of two Gaussian functions using Igor is described in the following section with an explicit example.

Fitting two Gaussians using Igor PDF

Fitting two Gaussians using Igor