Most data fitting carried in this group involves kinetic analysis of transient reaction kinetics. This page will provide practical guidance in kinetic fitting, but general approach is applicable to other processes. The goal of kinetic analysis is to identify number of processes involved, as well as finding their rates and amplitudes.
Prepare data for fitting.
Data prepration involves several realted steps:
- Choose dataset: If you data are in linear wave, presumably you have already chosen the best position (such as wavelength) before you carried the experiment. If you are dealing with matrix data, make graphs and analyze data to find positions at which the process either has the highest amplitude or is the most distinct from other. For studies involving heme proteins this is typically peak-through difference of Soret band in the 400-450 nm region. Almost all radical species absorb strongly in the mid- to far-UV.
- Extract time profiles in to a separate wave. It is possible to fit rows and columns in the matrix, but this can be done only from command line and often not as convenient. Alternatively you can set up a dependence relationship.
Prepare calibration wave. As described in Import, each set of temporal data should have its own time calibration because of how time dependences are measured. Calibration wave must have the same number of points as data wave, otherwise you will not see in dialog (it may still be possible to use waves of mismatched length in command line).
- Analyze time zero in time calibration. Generic exponential functions assume that process starts at t=0. In practice this is often not the case either because of hardware limitation or because of intentional measurement of pre-start reference. If error in estimation of t=0 is small comparing to the fastest process you can apply an offset to time calibration by subtracting delay time. It is a good idea to modify a copy of original time calibration. If the fastest detectable process is comparable to the error in delay time estimation it might be better leave calibration alone and include time delay in your fit function: instead of exp(-k1*t) use exp(-k1*(t-t0)). Increase in number of coefficients in this case may be better than arbitrary operator judgment. This is the case for both when start is fast but there are too few points to see it and when reaction initiation takes some time (i.e. mixing of reagent in solution).
- Plot your data vs calibration and select data range that you want to fit. Larger number of data often, but not always gives better fit. Examples of data that you do not want use in fitting include:
Data prior to reaction start unless you fit function describes a pre- and post-start data with different dependencies.
Interferences such stray photolytic light etc.
Large amount of data after reaction is complete. You want to take in to account post-reaction level either through including data or through constraining coefficients (if end-pint is known), but excessive fraction of "nothing" data may shift bias from process you are analyzing.
Onset of slower processes that are not well represented by your dataset. Is such slow process significantly overlaps with your process of interest and you cannot identify point when first is complete and second has not started, try to incorporate description of the slower process in fit function and manually constraining or even holding its parameters.
It is convenient to place cursors A and B at the beginning and the end of selected range.
Next, select function that you believe would describe selected range of data the best.
Choose fitting function.
This is the most critical and creative part of fitting analysis, that draws most heavily on external knowledge. We know that under typical transient kinetics conditions changes in concentrations of species over time will occur exponentially. Therefore, we can limit selection of dependence to exponential functions. Number of exponents involved, however, is often not known and needs to be found. From the principle of the least number of parameters we choose single exponential function as the starting point.
Knowledge of reaction mechanism is very helpful in increasing accuracy of fitting. Devise expression for relative concentration of each intermediate and add them with individual intensity coefficients (molar extinction in spectroscopy). If nothing is known about mechanism, use generic function.
Consider behavior at the reaction start as described above, include correction if necessary. Keep in mind that Igor has time-corrected version of single- and double-exponential functions. Consider possible intensity offset and/or drifts which are present in most cases to some extent.
If in doubt whether correction is needed or not, use simpler version. Necessity of correction will be more apparent after a round of fitting.
Set up fitting dialog:
Fitting dialog can be accessed at Curve fitting from Analysis menu. Carry the first round of fitting from dialog, while subsequent rounds can be done from command line.
With the exception of setting up initial guesses, fitting to built-in and user-defined functions are identical.
Set up function and data tab:

You will not be able to proceed with fitting unless you choose Function and Y Data (data wave). How formula for user-defined functions will be displayed in the window at the bottom depends on whether the function declaration included symbolic definition for values in coefficient wave.
While you can proceed with fitting without X Data (calibration wave), it is strongly discouraged. There are only few cases where fitting can be done meaningfully without X calibration.
If you cannot find the calibration wave that you expect to see - make sure that both data and calibration waves have the same number of points, otherwise fitting dialog will not list calibraiton wave.
Data options
Input data
Data options tab specifies what part of dat and how will be considered in fitting:
Range specifies overall point-based range of data to be used in fitting. By default all points from zero to the last one are used. User can clip the range on the lower and/or upper end by either explicitly specifying the point number or by calling the pcsr() function which returns point location of either of two cursors A and B.
Weighting allows to assign different importance (weight) to each point in the data set. If no weight wave is specified, a value of unitiy (1) is used for all points. When a weight wave is provided, Igor will make larger emphasis on fitting positions where weight value is larger and neglecting points with zero weight (N.B. Igor manual recommends to use mask wave to elliminate points completely). A rare case of when weithing may be necessary is when you know there is an intense early kinetic phase but due to time resolution you do not have enough points for Igor to recognise this phase automatically.
Specifying data mask wave istructs Igor ignore points with zero value in the mask wave. Points with any non-zero value willbe considered. Using mask allow to reduce interference from occasional atrifactual data, such as cosmic ray spike or accidental blocage of probe beam.
Note that both weight and mask waves must have the same number of points as data wave to be listed in corresponding drop-down menus.
If you are using a built-in function you can skip setting coefficients options. Remeber that by default output coefficients are stored in W_coef wave in case you want to copy them to another wave or display in a table.
Output data
Output Options tab specifies the desired feedback for fitting results:

Primary feedback tool is an overlay of fiting results over original data on th etop graph. This option is controlled by the Destination drop-down list:
_none_ |
no feedback; use for well-tested fitting routines |
_auto_ |

Fitting results will be places in a wave named from data wave with fit_ prefix;
wave will be appended to the graph using the same calibration as was used in fitting.; |
_new wave_ |

A new wave with given name will be created, but not appended to graph; The points region between start and end will contain results of fitting, outside of this region - original data from data wave. |
Any existing wave |
Similar to the _new wave_ option, exept that you browse to your existing wave of choice withthe same number of points. You can browse to the wave that was created erlier using _new wave_ option. |
Residual drop-down list specifies options for dispalying the difference between your original data and the result of fitting:
_none_ |
no residuals |
_auto trace_ |
Residual will be places in a wave named from data wave with res_ prefix;
wave will be appended to a separate pane on the top graph using the same calibration as was used in fitting;
|
_auto wave_ |
Identical to _auto trace_ except that the new residual wave is not appended in the top graph |
_new wave_ |
works exactly as with Destination option |
Any existing wave |
works exactly as with Destination option |
Guesses
If you are using a user-defined fit functions you must set up initial guesses for all parameters:
The Graph Now button makes guessing values an easier task. There is no need in getting output curve match data exactly - as long as shape and amplitudes resemble input data, fitting will probably get it better and faster.
In complex fitting models it is sometimes useful to fit values of some processes while holding others before allowing all parameters to vary freely. Hold checkbox stops Igor from adjusting a particuar parameter while still using it in calculation.
A less severe limitation can be applied through Constraints wave. When From Coefficients List is chosen from a drop-down menu, you can specify lower, upper or both limits for acceptable value for each parameter. Such constraints are not limited to constant numerical values, but can include other parameters in the fit.
By default Igor creates and used T_Constraints wave in the current folder. You can create your own constraint wave wave in any folder. Constraint wave is a text wave with the number of entries equal to the number of constraints, not the number of parameters. Each line must contain one constraint in text form: K0 < K1+K2*2.5 or K3 > K1 * 10.
Note that realtionship constraints K0 < K1 are using K0, K1 etc notation in reference to coefficients. This applies to constraints in From Coefficients List in Curve fitting dialog as well, even though parametes are listed as they were named in function (A, B, t0 etc).
Do the fit
Once all prepartion has been done, click Do It button and let Igor do the hard part.
Depending on your data size, complexity of function and required confidence level, fitting may take from a fraction of a second to several hours.
There is little you can do during fitting process except for interrupting it if you see that fit is diverging and parameters assume unreasonable values. During fit you will see a progress dialog which displays results of the last iteration. You will have to remember which K parameter corresponds to those third and fifth exponential rate constants is you want to track the progress.
Analyze the results
Upon completion, results of fitting are reported in the history area. Examining this report is the first stage of analysis.There are three possible outcomes:
symptom |
cause |
what does it mean |
Error dialog |
An error in computation brings out a Singular Matrix Error dialog and aborts fitting. |
This is likey caused by a gross problem with fitting function: either a parameter is not used or computation produced an invalid number, such as division by zero. |
XX iterations with no convergence |
Computation are valid, but Igor can not reduce the error between computed and original data. |
The likley causes of this are the choice of incorrect function, poor guess of initial parameters or excessive constraining |
Fit converged properly |
Mathematically successful fit |
Practicaly this means that error has been significantly reduced due to all variable parameters. For the operator, however, this may be only the initial point. |
Once the fit has converged, proceeed to the second stage of analysis: visually examine how close is your fit to the original data. Overlay of the fit profiles and residuals pane are very helpful (see suggestions).
In visual examination look for mismatching patterns, paying attention to entire range of data. Deviation over the few first or last points may suggest the presence of an additional - faster or slower - process (see suggestions).
If you had limited the data range in input data options, calculate fit results for the entire range - extrapolation to unusualy high/low values at time zero and at longer time may suggest that chosen function does not describe data as well as it could.
Watch out for nonsence results such as negative rates, negative amplitides in absolute spectra, multiple rates with close values etc.
Upon completion of the second stage you need to decide if the fit results were adequate. If you are not satisfied with the fit, revise you fitting function, alter initial guesses, or apply constraint / hold to parameters and repeat the fit.
When you are satisfied with the resutls, proceed to the third stage of analysis, which should involve involve knowledge beyond current data set. This may include a priori knowledge about phenomenon from the first principles, other studies, or other measurements within the series. Compare fitting results at different concentrations or profiles at different wavelengths. Keep in mind that various phases of the same process may be resolved better or worse at different wavelengths.
Practical suggestions
Use fit and residual overlay plots in visual analysis. To help you compare original and computed data, set the mode of original data trace to Markers (double-click trace to bring up Modify Trace Appearace dialog) and set fit results trace to lines betwen points. If your plot has several datasets, distinguish them by color.
Use logarithmic time axis mode for kinetic data - Mode box in Modify Axis dialog. Visually Log axis gives the same weight to all kinentic phases. This is especially important for very fast and very slow phases, which are hard to see using linear axis. Keep in mind, however, that you can not see data at negative times on log scales. Kinetics of early phases in reactions that started with a delay will look distored on log axis, although this will not affect the fit. Consider applying an offset to time calibration.
Make a table with fit coefficients wave (default W_coef wave). This wave will be updated with results upon completion of fit. If you are fitting to a user fitting function, values in this wave will be used as initial guesses . Likewise, if you are using constraints, display and edit constraints wave in a table. You can display both the coefficients and constraints waves in the same table.
When fine-tuning coefficients use command line, instead of dialog. Earlier execution of fitting dialog will leave literaly command in the history area (Ctrl+J). The first line of fitting report contains information about all options you seledcted for that fit:
FuncFit MyTestFitFunction W_coef MyTestWave /X=MyTestClb /D=New_FitDestination /R
Copy this entire line to the command line and execute it (Enter). Besides saving time and clicking, this will allow you to use the final coefficients from the last round as initial guesses for the next one.
In complex exponential fitting use constraints. One of the easiest types of constraint is the limit on how close the rates of phases can be. In most cases of conventional fitting, concurrent phases that differ less than 20-50% in their rate constants will likely not be resoved. Applying a constraints K0>K1*1.5; K1>K2*2 etc.
will prevent possible collapse of separate phases in to one.
Use hold to approximate phases that are not well resolved in data set. Every coefficient used in fitting affects every other. Even though you may not be able to get a reliable fit for very fast or very slow phases, it might be better to estimate and hold their rates rather than completely ignore them. In general, it is difficult to get a good fit for a phase if less than half of its amplitude is represented in the data. Nevetherless, presense of such partial phase may affect the fit of better resolved phases. To make an estimate of partially resolved phase, use Graph Now button in coefficients tab of fitting dialog while making manual adjustment. When reasonable value is found set hold flag for corresponding coefficient(s) and run the fit. Making and estimate will be easier if you run a round of fitting first to get an idea about other parameters.
Use fitting report from history window. Each successful fitting leaves a "hardcopy" printout of results in the history. Most of the results are reported in such a form that you can directly copy-and-execute them. For example, you can restore values of coefficients by executing the
W_coef={16.401,-20.493,0.14436
statement from the report even if coefficients were altered in subsequent fitting (mind changes in the number of coefficients!). Other lines from the report allow you to re-assign calculated data and residuals
New_FitDestination= MyTestFitFunction(W_coef,MyTestClb)
Res_MyTestWave= MyTestWave - (MyTestFitFunction(W_coef,MyTestClb))
just as Igor has done during fitting, except that these calculations will apply to entire range rather than the range used in fitting. This is useful for extrapolating data outside of the fitted range.
|