PFM Manual
PFM Manual
TM
PFM
OriginLab Corporation
Copyright © 2002 by OriginLab Corporation
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form
or by any means without the written permission of OriginLab Corporation.
OriginLab, Origin, and LabTalk are either registered trademarks or trademarks of OriginLab
Corporation. Other product and company names mentioned herein may be the trademarks of their
respective owners.
OriginLab Corporation
One Roundhouse Plaza
Northampton, MA 01060
USA
(413) 586-2013
(800) 969-7720
Fax (413) 585-0126
www.OriginLab.com
Contents
Index 115
=> If you are upgrading your Origin/PFM software and you selected to
upgrade your existing copy of Origin (as opposed to installing Origin 7
into a new folder, leaving the existing copy of Origin unaltered), then
you must uninstall your previous version of the PFM before installing the
new PFM. If you installed Origin 7 into a new folder (whether or not
you transferred your old settings), then you can directly install the new
PFM into this folder.
To uninstall a previous version of the PFM, perform the following
operations:
1) Start Origin. (If Origin is already open and if you have run the Peak
Fitting wizard in the current Origin session, close Origin and then restart
Origin. If Origin is open and you have not run the wizard in the current
session, proceed to the next step.)
2) Select View:Toolbars. This opens the Customize Toolbar dialog
box.
3) On the Toolbars tab, select the PFM entry from the Toolbars list box.
(You can click on the text or in the check box.)
4) Click the Delete button. This action removes the PFM from the
Toolbars list.
5) Select the Button Groups tab.
6) Select PFM from the Groups list box.
7) Click the Delete button in the Button Group group.
Installing the PFM and Getting Started Installing the PFM • 1
8) Click the Yes button in the Button Group attention box.
9) Close the Customize Toolbar dialog box.
=> The Origin 7 PFM checks that your Origin software is registered
before installing. If your Origin software is not registered, the PFM will
not install. To check if your software is registered, start Origin and then
select Help:About Origin. If your software is registered, a Registration
ID displays in the About Origin dialog box. If the Registration ID field
is blank, click the OK button to close this dialog box and then select
Help:Register Online. Click the Continue button in the OriginLab
Registration dialog box. This action opens the Registration dialog box.
Select the Register Now radio button and then click the “Click here to
Register on-line and receive your Registration ID” button. Follow the
instructions on the OriginLab website to complete the registration
process.
3) Select the PFM from the list box and click Uninstall.
Session button on the PFM toolbar. This button opens the Peak
Fitting wizard with the active dataset displaying in the wizard graph.
4 • Getting Started Using the Wizard Installing the PFM and Getting Started
Peak Fitting Wizard
Tutorials
Introduction
Three tutorial lessons are provided to help you get started using the Peak
Fitting wizard.
"Tutorial 1, Introduction to the Peak Fitting Wizard" on this page: This
tutorial introduces you to the pages and controls on the Peak Fitting
wizard. You will step through each page of the wizard using a sample
dataset.
"Tutorial 2, Analyzing Data with Hidden Peaks" on page 17: This
tutorial introduces you to the Peak Fitting wizard's baseline points and
peak finding algorithms. You will learn how to review the second
derivative. You will also learn how to set a lower bound on a parameter.
"Tutorial 3, Creating a Customized Wizard" on page 25: This tutorial
steps you through the process of creating a custom wizard. You will hide
pages on the Peak Fitting wizard. Some hidden pages will be pre-set to
perform custom actions. Other pages will be set to perform no actions.
You will create a custom toolbar button to run your custom wizard.
Getting Started
1) Start Origin and then click the Open button on the Standard
toolbar.
2) Select PFM_Examples.OPJ from the list of available files in the
Origin folder and click the Open button. The project opens with a notes
window active in the workspace.
3) If the Project Explorer is not currently open, click the Project
6) Click the Enter Peak Fitting Session button on the PFM toolbar.
The Peak Fitting wizard opens displaying the Graph3 data.
The wizard map on the left side of the wizard provides navigation
through the wizard (in addition to the Next and Back buttons). However,
you can hide the wizard map so that your view of the wizard graph
located on the right side of the wizard is enhanced.
7) Right-click in the blank gray area of the wizard next to the Help
button. This action opens a shortcut menu.
8) Select Show Wizard Map from the shortcut menu. This action de-
selects the menu command and hides the wizard map.
9) Click the wizard's Maximize button to maximize the wizard's
display on your screen.
6 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
Selecting a Range of Data
Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard • 7
Defining the Baseline
1) Click the Next button to advance to the Precondition Data wizard
page. This page allows you to precondition and apply a smoothing filter
to your data.
2) Click the Next button to advance to the Baseline Points page. This
page provides controls to select (or initialize, if you will be allowing the
baseline to vary during the fit) the baseline points. You can select a
constant or a reference dataset, or you can graphically define the baseline
points or use the Peak Fitting wizard's baseline finding algorithm. The
default Constant selection defines an appropriate baseline for this data.
8 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
Finding Peaks Automatically
The Pick Peaks algorithm finds peaks by searching the smoothed second
derivative of the peak data looking for peaks that are above a noise
threshold. The noise threshold can be increased or decreased from the
associated combo box to drop or add peaks. As you increase this value,
the algorithm finds less peaks.
In this example, we'll mark the currently unmarked peaks at the
beginning and end of the dataset manually.
2) Click the Next button to advance to the Define Peaks page. This page
provides controls to add, modify, or delete peaks from the wizard graph.
3) Click the Enlarger button on the wizard and enlarge the two
unmarked peaks in the wizard graph whose centers are approximately
located at X = 4 and X = 5.
Note: If you don't enlarge the desired area, click the Rescale button
on the wizard and then re-click the Enlarger button and drag the
area again.
Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard • 9
Enlarging a Section of the Wizard Graph
4) Click the Add button and then double-click to define the two peak
locations.
6) Click the Rescale button on the wizard to rescale the axes to the
full range.
10 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
7) Click the Enlarger button on the wizard and enlarge the last
(unmarked) peak in the wizard graph whose center is approximately
located at X = 15.5.
8) Click the Add button and then double-click to define the peak
location.
9) Click the Done button.
10) Click the Rescale button on the wizard to rescale the axes to the
full range.
Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard • 11
improve the overlay of the theoretical curve to the data: a red peak
center line, a red peak height line, and a black peak width line with red
control handles on the ends.
The Peak Edit View Box with the First Peak Active
2) Move the cursor so that it is pointing over the last peak in the wizard
graph (whose center is approximately located at X = 15.5). The mouse
pointer will display as a hand pointer in this location.
12 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
The Peak Edit View Box with the Last Peak Active
4) Drag one of the width control handles in the peak edit view box and
increase the width of the peak's theoretical curve so that it resembles the
width of the peak (black scatter points).
You may need to click the button located in the peak edit view box to
rescale the view box.
5) If necessary, adjust the peak center in the peak edit view box by
dragging the peak center line left or right, as needed.
Fine-tuning the Parameter Values using the Peak Edit View Box
Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard • 13
2) Click the Fit button to perform, at most, 10 Levenberg-Marquardt
iterations, as specified in the Number of Iterations drop-down list (and
the Tolerance text box).
The fit should converge in only a few iterations. The output view box
lists the number of iterations performed and the reduced chi-square value.
Additionally the updated fit curve displays in the wizard graph.
14 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
Displaying the Fit Curves for the Individual Peaks
Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard • 15
button of the associated result will be enabled in the Available Results
for Display group.)
7) Click the OK button to close the dialog box.
8) In the Peak Characterization Report group, click the Plot button.
The graph report is created in the Origin project. Because the wizard
remains active, the graph displays behind the wizard.
9) Minimize the Peak Fitting wizard to view the graph report.
10) A Reminder Message may display indicating that the graph report is
displayed using speed mode. Click the OK button if this Reminder
Message displays.
11) Click the Restore button on the Peak Fitting wizard's title bar to
restore the wizard's display.
12) In the Fitting Function Parameters group, click the Worksheet
button.
16 • Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials
The fitting function parameters worksheet report is created in the Origin
project. Because the wizard remains active, the worksheet displays
behind the wizard.
Getting Started
1) Open the PFM_Examples.OPJ file if it is not currently open.
2) In the Project Explorer, activate the Graph1 graph window located in
the Chromatography Data folder.
3) Click the Enter Peak Fitting Session button on the PFM toolbar.
4) Right-click in the blank gray area of the wizard next to the Help
button. This action opens a shortcut menu.
5) Select Show Wizard Map from the shortcut menu. This action de-
selects the menu command and hides the wizard map.
6) Click the wizard's Maximize button to maximize the wizard's
display on your screen. (Note: If you are continuing from Tutorial 1,
you may need to Restore Down first, and then maximize the wizard.)
7) Click the Line Plot button located below the wizard graph. The
peak data displays as a line data plot in the wizard.
Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks • 17
Selecting a Range of Data
1) Click the Select Range button.
2) Drag the left data marker to approximately X = 11.
3) Press ENTER to fix the marker and exit the range selection mode.
The graph updates displaying the selected range.
18 • Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials
Finding Baseline Points using the Baseline Detection Algorithm
5) Click the Next button to advance to the Create Baseline wizard page.
By default, the detected baseline points are fit using a line function.
Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks • 19
Finding the Peaks
1) Click the Next button to advance to the Peak Finding wizard page.
2) With the Threshold Height radio button selected in the Find Peaks
group, click the Pick Peaks button. Thirteen peaks are found and marked
with magenta vertical lines in the wizard graph.
20 • Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials
Displaying the Second Derivative
4) Click the Enlarger button on the wizard and enlarge the area on
the graph between approximately X = 12 and X = 17 (see the following
figure).
Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks • 21
Updated Wizard Graph
5) Click the Threshold Height down arrow once and then re-click the
Pick Peaks button. One additional peak is found in the peak data, with a
center at 13.
22 • Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials
6) Click the Rescale button on the wizard to rescale the wizard
graph axes to their full range.
7) Click the 2nd Derivative button on the wizard to turn off the
display of the second derivative.
8) Click the Next button to advance to the Define Peaks wizard page.
9) Click the Add button and then double-click to define the negative
peak at approximately X = 19.
Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks • 23
2) For the Area parameter of peak 2, select the LBound check box. (Tip:
First click on the text “Area” in the Parameter column for Peak #2. This
action highlights the entire row. Then scroll or resize the dialog box to
view and select the LBound check box.)
3) For this same parameter, double-click in the Lower Bound field to
enter the editing mode. Then type 0.0.
24 • Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials
Performing the Fit
Getting Started
1) Open the PFM_Examples.OPJ file if it is not currently open.
2) In the Project Explorer, activate the Graph5 graph window located in
the Chromatography Data folder.
3) Click the Enter Peak Fitting Session button on the PFM toolbar.
4) Right-click in the blank gray area of the wizard next to the Help
button. This action opens a shortcut menu.
5) Select View Mode:Full from the shortcut menu. This action adds
check boxes to the page icons on the wizard map. These check boxes
allow you to disable the display of wizard pages.
4) Click the Finish button. This action opens the Button Settings dialog
box.
5) With the top, left button selected, type Auto Find Baseline and
Peaks in the Tool Tip and the Status Bar text boxes.
6) Click the OK button to close the dialog box and the Peak Fitting
wizard. Additionally, a new PFMWiz toolbar displays in the Origin
workspace with the button that you just created.
Introduction
After clicking the Enter Peak Fitting Session button, the Peak Fitting
wizard opens with the active dataset displaying in the wizard graph.
To navigate through the Peak Fitting wizard, click the Next (and Back)
buttons, or click the page icons on the wizard map located on the left side
of the wizard. The page icons on the wizard map are color-coded to
indicate the active page (green), a page that has not been visited (yellow),
a page that has already been visited or skipped (brown), and the last
wizard page (red).
Return the wizard graph to the full axis scales. For more
information, see "Enlarging a Section of Interest in the Wizard Graph" on
page 53.
Display the residual plot. For more information, see "Checking the
Fit By Reviewing the Residuals" on page 64.
Display the theoretical curve for the individual peaks. For more
information, see "Optimizing the Initial Parameter Values" on page 56.
The following shortcut menu commands are available on the Peak Fitting
wizard:
To open the Peak Fitting wizard’s shortcut menu, right-click in the blank
gray area of the wizard next to the Help button.
View Mode: There are two available wizard view modes, normal
(default) and full. The Full view mode is a wizard design mode. This
view mode provides check boxes next to the page icons on the wizard
map. You can hide a wizard page by clearing its check box. This allows
you to create custom wizards for specific peak analysis. To learn more
about hiding wizard pages and creating custom wizards, see "Tutorial 3,
Creating a Customized Wizard". Additionally, see “Creating a Custom
Wizard” on page 80.
Action Mode: There are two available action modes, active (default)
and passive. The passive action mode allows you to switch wizard pages
without initiating any actions. The passive action mode can be used with
the full view mode when creating a custom wizard. To learn more about
creating custom wizards, see "Tutorial 3, Creating a Customized
Wizard". Additionally, see “Creating a Custom Wizard” on page 80.
To define a range of data, click on the left or right marker and drag it to
the desired location. The XY values of the associated data point display
in the Current Marker Position group. When you complete your range
selection, press ENTER or double-click on a marker to exit the range
selection mode.
After selecting a range of data, the From and To view boxes in the
Dataset group update to display the associated X data values for your
range selection.
Select the data preconditioning method from the Methods drop-down list.
Depending on the selected method, associated text boxes display next to
the Methods drop-down list. For example, if the Subtract an Offset From
Data option is selected, a Y Offset text box displays. Type the desired
value in the Y Offset text box. The Description view box displays a
description of the currently selected data preconditioning method. These
descriptions are reproduced below:
1) Subtract an offset from data. Subtract the data by a given value Y0.
2) Subtract mean (1) from data. Average the data between row R1 and
R2, then subtract the resulting mean from the data.
3) Subtract mean (2) from data. Average the data between X1 and X2,
then subtract the resulting mean from the data.
4) Subtract mean (3) from data. Subtract the mean of the first N rows
from the data.
5) Subtract mean (4) from data. Subtract the mean of the last N rows
from the data.
6) Subtract mean (5) from data. Subtract the mean of all points to the
left of X from the data.
7) Subtract mean (6) from data. Subtract the mean of all points to the
right of X from the data.
42 • Defining How the Baseline Points Should be Used to Create a Baseline Peak Fitting Wizard Reference
Modifying the Baseline Points
Select the Modify Baseline Points radio button to access the baseline
modification tools.
Note: After modifying the baseline points, you must select the Create
Baseline radio button on this wizard page to specify how the baseline
points will be used to create the baseline. You cannot proceed in the
wizard until completing this step.
1) Click the Add button to add baseline points. The Add button
activates the Screen Reader tool in the wizard graph. Additionally, a
Current Marker Position group displays on the wizard page. As you
click at a location in the wizard graph, the XY values of the associated
point display in the Current Marker Position group. To add a baseline
point, double-click at the desired location or click once and press
ENTER. When finished adding baseline points, click the Done button.
To force the defined baseline points to fall on the plotted dataset, select
the Points in Data check box. In this case, after you define the baseline
points and click the Done button, Origin will find the nearest data point
(in X) from the original dataset for each baseline point, and will then
move the baseline point so that it shares the same Y value as this original
dataset point.
2) Click the Modify button to modify the baseline points. The Modify
button activates the Data Reader tool in the wizard graph. Drag a data
point to a new location. When finishing modifying the location of the
data points, click the Done button.
3) Click the Delete button to delete a point from the baseline. The
Delete button also activates the Data Reader tool in the wizard graph.
Double-click on the desired data point to delete it. Alternatively, click on
a point and press ENTER to delete it.
Peak Fitting Wizard Reference Defining How the Baseline Points Should be Used to Create a Baseline • 43
For more information on these functions, see "Peak and Baseline
Function Reference".
The Set/Modify button opens the Select Fitting Function dialog box.
46 • Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference
The Select Fitting Function Dialog Box
The Available Functions list box lists the available peak fitting functions.
By default, the following peak functions are provided:
All built-in functions are included in this list box. To modify the list of
functions, edit the [FittingFunctions] section of the PFM.INI file located
in the Origin software folder. For more information on these functions,
see "Peak and Baseline Function Reference".
When you select a function from the Available Functions list box, the
Function Name, Function Type, # of Parameters, Function Parameters,
and Function Description view boxes update to display the respective
function information. This information is read from the function's FDF
file located in the \FITFUNC subfolder.
Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks • 47
Modifying and Defining New Functions
Click the Modify button to modify a function listed in the Available
Functions list box. Click the Define New Function button to define a
new fitting function. Both buttons open a similar dialog box. However,
the dialog box is titled and behaves differently depending on whether you
are modifying an existing function or defining a new function.
The Define New Peak Function (or Modify Peak Function) Dialog
Box
If you are modifying an existing function, edit this dialog box to rename
the function, initialize the parameters, or define the lower and upper
bounds. If you are modifying a user-defined function, you can also
modify the function's definition. However, for built-in functions, you
can not modify the function description.
If you are defining a new function, edit this dialog box to name the
function, select the function form, define the function, initialize the
parameters and define their lower and upper bounds.
48 • Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference
Naming the Function
The Name text box lists the default function name. For new functions,
default names like Peakn are suggested. You can modify these names,
but do not use names that are already in use.
50 • Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference
Assigning Parameter Names
Type the parameter names in the Names text boxes provided. The first
three parameters must be prefixed xc (center), A (area or height), and w
(width).
Note: When the Use Area in Definition check box is selected, the second
parameter in the peak function definition is the area of the peak. When
cleared, it is the height of the peak. The default is to use the area.
Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks • 51
2) When the Number of Peaks radio button is selected and the Pick
Peaks button is clicked, the peak finding algorithm searches the
smoothed second derivative of the peak data looking for the n tallest
peaks, where n is specified in the associated combo box.
After you edit the Threshold Height or the Number of Peaks combo
boxes, click the Pick Peaks button to update the wizard with the resultant
peak markers. To fine tune the peak finding selection, continue to re-edit
the combo boxes and click the Pick Peaks button.
Note: The Peak Finding wizard supports a maximum of 240 peaks per
dataset.
To improve your view of the peak finding algorithm results, you can
you can enlarge of section of data using the Enlarger button located
below the wizard graph. After you click this button, drag a rectangle
around the peak(s) of interest. When you release the mouse button, the
axes rescale to display only the selected data. Once you enlarge a region
of interest, you can scroll along the X axis by clicking the Scroll Left
To return to the full axes scale, click the Rescale button on the
wizard.
Peak Fitting Wizard Reference Assigning Peak-specific Functions and Initializing Parameters • 55
Selecting the Active Peak in the Wizard Graph
56 • Assigning Peak-specific Functions and Initializing Parameters Peak Fitting Wizard Reference
the curve). When you resize the theoretical curve using this view box,
you are changing the initial parameter values. The changes you make are
immediately visible in the wizard graph if the Update Graph When
Params. Change check box located below the view box is selected. If
this check box is cleared, the wizard graph updates when you click the
Redraw button located below the view box.
Note: For more control over the peak parameters, see "Fixing and
Sharing Parameters and Setting Constraints" on page 58.
In cases where the individual parameters cannot be mapped explicitly to
area, height, or width, the peak edit view box must be handled carefully.
The width should be set first, taking care that the height and center stay
close to their desired values. The height should be set next making small
corrections whenever necessary to restore the width to its preset value.
The center should be set last. Please note that small differences between
the theoretical curve and the peak data will not affect the fit stage. The
initialization needs to be close enough to obtain a good fit - that is all.
Also, please note that for some functions like the ECS, the peak edit view
box controls do not correspond exactly to the height, center, or width, but
can be used to vary them. An exact fit is normally not required. A
reasonable overlay of the theoretical curve on the peak data is sufficient
for good fitting in most cases.
To expand the X axis scale range in the view box, click the button.
To reduce the X axis scale range in the view box, click the button.
These buttons only affect the X axis scale of the view box. They have no
effect on the parameter values or the axis scale range in the wizard graph.
As you fine-tune the parameter values for the peaks using the peak edit
view box, you can see the effect on the theoretical curve for the
individual peaks in the wizard graph. To enable the display of the
theoretical curve for the individual peaks, click the Individual Peaks
Peak Fitting Wizard Reference Assigning Peak-specific Functions and Initializing Parameters • 57
Displaying the Theoretical Curve for the Individual Peaks in the
Wizard Graph
As you adjust the height, width, and center of the theoretical curve in the
view box, you can more easily see the changes in the wizard graph if you
the Parameter Display button below the wizard graph) allows you to
58 • Fixing and Sharing Parameters and Setting Constraints Peak Fitting Wizard Reference
fix parameter values, share parameters among peaks, and set parameter
constraints including upper and lower bounds and general linear
constraints. Additionally, you can select a different function to fit to a
peak, and edit the parameter values.
Peak Fitting Wizard Reference Fixing and Sharing Parameters and Setting Constraints • 59
Note: If there are a large number peaks in your peak data, or if the
baseline is very complex, and you did not subtract the baseline from your
peak data, it may be best to fix the baseline parameter values before
fitting. Otherwise, smaller peaks that are close to the baseline could
cause the baseline to stray during the fitting process.
Enter the constraints in the text box provided. If there is more than one
constraint, separate constraints by a semicolon (;). To enter constraints
60 • Fixing and Sharing Parameters and Setting Constraints Peak Fitting Wizard Reference
on multiple lines, press CTRL+ENTER to move the cursor to the next
line.
When entering constraints, the parameter names must be specified using
the following notation:
ParameterName_PeakNumber
For built-in functions, ParameterName is listed in the Function
Parameters list box of the Select Fitting Function dialog box (click
Set/Modify on the Peak Finding wizard page). Alternatively, parameter
names are listed for each built-in function in "Peak and Baseline
Function Reference". For user-defined functions, ParameterName is
specified in the Define New Peak Function dialog box.
PeakNumber is the number listed in the Peak # column of the Peak
Parameters Display dialog box.
For example, if peak number 5 is set to a Gaussian function, its parameter
names for the center, area, and width are xc_5, A_5, and w_5.
When entering constraints, five relational operators are supported: =, <,
<=, >, and >=. However, the Peak Fitting wizard treats < as <=.
Similarly, the Peak Fitting wizard treats > as >=.
Constraint Example: To limit the distance between the center of
Gaussian peak number 2 and the center of Gaussian peak number 1 to 25,
type xc_2 - xc_1 <= 25 in the text box.
Note: You can temporarily disable the specified general linear
constraints by clearing the Enable check box. Constraints take effect
only if this check box is selected.
Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit • 61
The Fit Wizard Page Controls
62 • Controlling the Fitting Procedure and Performing the Fit Peak Fitting Wizard Reference
Setting Confidence and Prediction
Band Levels
Specify the desired confidence level for the confidence and prediction
bands in the associated text boxes. To display confidence and prediction
bands, click the Confidence Bands button and the Prediction Bands
button located below the wizard graph. To turn off their display,
click a second time on the respective button.
Note: If the confidence and prediction bands display in the wizard graph,
then they are also included in the graph report accessible from the
Results wizard page.
The confidence interval indicates how good your estimate of the value of
the fit curve is at particular X value. You can claim with 100*a%
confidence that the correct value for the fit curve lies within the
confidence interval, where a is the confidence level. (To report the
confidence interval on the parameters after fitting, see “Reporting the
Fitting Function Parameters and the Fitting Statistics” on page 66.)
The prediction interval is the interval within which 100*a% of all the
experimental points in a series of repeated measurements are expected to
fall at particular values of X, where a is the prediction level.
Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit • 63
1) No weight. The weight for each data point = wi = 1 . The sum of
squares = ∑(y i − fi ) .
2
wi = 1 / y i
1/ 2
2) Statistical. The weight for each data point = . The
sum of squares = ∑ (y i − f i ) 2 / yi .
3) Instrumental. This option is only available if the worksheet
containing the peak data includes a Y error column. The weight for each
data point = wi = 1 / σ i , where σ i is the error size for each data point
as specified in the selected error dataset. The sum of squares =
∑ [( y − fi ) / σ i ] .
2
i
64 • Controlling the Fitting Procedure and Performing the Fit Peak Fitting Wizard Reference
Hidden peaks that were not marked as peaks will usually display as peaks
in the residual plot. The following figures illustrate the use of the
residual plot for identifying hidden peaks.
Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit • 65
Reporting the Results
The Results wizard page allows you to create reports on the fitting
function parameters, fitting statistics, and the peak characteristics. Both
worksheet and graph reports are available. Additionally, you can save
the current peak positions to an ASCII file for initializing peak locations
when you analyze a similar dataset. You can also save the peak and
baseline characteristics and the report settings to an initialization file for
re-use.
1 ∞
mn ' =
m0 ∫
0
F ( x) x n dx where n ≥ 1 (nth zero-point moment)
bands in the wizard graph, click the Confidence Bands button and
the Prediction Bands button located below the wizard graph. To
enable the display of the fit curves for the individual peaks, click the
The graph report provides the same options as the worksheet report, with
the additional option for displaying the peak number and function type,
which is not optional in the worksheet report. These fitting results
display beneath the plot of the fitted data in the graph report.
To edit this dialog box, first select the number of fields to display in the
graph report by selecting or typing a value in the Total Number of Fields
combo box. Note that you can modify this combo box value after you
begin selecting report fields.
After customizing the Total Number of Fields combo box, the Available
Fields on Report Plot updates displaying the specified number of fields.
To assign a peak characteristic to a field, select the field from the
Available Fields on Report Plot list box and then select the desired peak
characteristic from the Available Results for Display group. For a
description of the available peak characteristics, see "Reporting the Peak
Characteristics in a Worksheet Report" on page 69.
After selecting a peak characteristic from the Available Results for
Display group, the default graph report title for that peak characteristic
displays in the Current Field Title text box. Edit the title if desired.
0
4.5x10
0
4.0x10
PFMData_B
0
3.5x10
0
3.0x10
0
2.5x10
0
2.0x10
10 12 14 16 18 20 22
PFMData_A
Fitting Results
Peak # Peak Type AreaFitT FWHM MaxHeight CenterGrvty AreaFitTP
1 Gaussian 0.35114 0.97814 0.33725 12.9929 8.67708
2 Gaussian 0.03547 0.27289 0.12209 13.02015 0.87641
3 Gaussian 0.08001 0.22488 0.33423 13.23607 1.97704
4 Gaussian 0.09055 0.17085 0.49789 13.4174 2.23755
5 Gaussian 0.33451 0.30237 1.03928 13.68053 8.26604
6 Gaussian 0.26136 0.19968 1.22964 13.96167 6.45849
7 Gaussian 0.65634 0.37557 1.64174 14.31949 16.21901
8 Gaussian 0.44596 0.19658 2.13114 14.73408 11.02011
9 Gaussian 0.20939 0.21462 0.91653 15.00353 5.17421
10 Gaussian 0.45349 0.17956 2.3726 15.28102 11.20626
11 Gaussian 0.22668 0.26203 0.81268 15.63787 5.60154
12 Gaussian 0.35286 0.19394 1.70922 16.03141 8.71965
13 Gaussian 0.15706 0.21467 0.68735 16.5979 3.88126
14 Gaussian 0.02145 0.25789 0.07815 16.9477 0.53015
15 Gaussian 0.01018 0.20475 0.0467 17.96634 0.2515
16 Gaussian 0.00469 0.15292 0.0288 18.60927 0.11586
17 Gaussian -0.04761 0.27402 -0.16322 19.04303 -1.17646
18 Gaussian 0.41827 0.22332 1.75958 19.76359 10.33607
19 Gaussian -0.01504 0.28704 -0.04924 20.55382 -0.37175
4.04674
BaseLine: Line
Click the Prev Peak and Next Peak buttons to select the desired peak.
Then select the desired peak characteristic from the Operations list box.
Click the Compute button to compute and view the following peak
characteristics. If necessary, type the requested value in the text box
provided.
Cumulative area: The cumulative area from − ∞ to X. Note: X is
relative to the peak center.
Area between X1 and X2: The area of a strip of the peak between two
vertical lines passing through X1 and X2.
Area above a given width: The area above a horizontal line whose end
points on the peak are W apart.
Area above a given height: The area above a horizontal line at height H.
Area above P% of maximum: The area above a horizontal line at a
height equal to P% of the peak maximum.
X1 and X2 at given height: The left and right intercepts of a horizontal
line at height H.
X1 and X2 at P% of maximum: The left and right intercepts of a
horizontal line at a height equal to P% of the peak maximum.
Peak resolution: The peak resolution between two peaks.
Peak 0 - 4th order moments: The peak moments from the 0th to the 4th
order. (0th order = peak area, 1st order = mean retention time, 2nd order
This dialog box allows you to save your current wizard settings and
actions to a new toolbar button.
When the Button Settings dialog box opens after you click the wizard's
Finish button, the top left button in the dialog box will be depressed.
You can assign your custom wizard settings to this button or you can
select another button. Note: This dialog box does not recognize if a
bitmap button is already in use.
You can specify a ToolTip and status bar message for your button.
Note: If you want to save your current wizard settings to the default
Peak Fitting wizard button on the PFM toolbar, select the Save check
box.
After you click the OK button, Origin adds this button to a new PFMWiz
toolbar.
Introduction
The Peak Fitting wizard allows you to fit your data to any function.
Many common models are provided as built-in functions - which offer
exceptional speed and reliability. You can also choose your own
functional form through user-defined functions.
To learn how to define your own fitting function, see "Peak Fitting
Wizard Reference".
To learn how to create a user-defined fitting function in an external DLL,
see "External DLL Functions" on page 95.
Gaussian
( x − xc ) 2
A 4 ln(2) −4 ln( 2 )
y= ⋅ e w2
w π
xc: Center
A: Peak area
w: Full width at half maximum
LabTalk script access: gaussian(xc, A, w)
Gauss2
Gaussian function in the form used for chromatography.
A
f ( x) = e − ( x − rt ) / 2σ
2 2
σ 2π
rt : Time of peak max; the retention time
A: Peak area
σ : Standard deviation of the peak (sd)
LabTalk script access: gauss2(rt, A, sd)
EMGauss
Exponentially modified Gaussian function.
1 σG
2
x −xG y2
A − 1 −
f (x ) =
z
∫
2 τ τ 2
e e dy
τ −∞
2π
x − xG σG
z = −
σG τ
τ : Time of peak max. - retention time
A: Peak area
σG: Standard deviation of the peak (sd)
Lorentz
2A w
y= ⋅
π 4 ( x − xc ) 2 + w 2
The Lorentzian function.
xc: Center
A: Peak area
w: Full width at half maximum
LabTalk script access: lorentz(xc, A, w)
Voigt
2 ln( 2 ) wL
y = A⋅
π 3/ 2 wG 2
e −t
2
∞
⋅∫ 2 2
dt
−∞
w x − xc
ln( 2 ) L + 4 ln( 2 ) − t
wG wG
A: Peak area
xc: Center
wG : Full Gaussian width at half maximum
wL : Full Lorentzian width at half maximum
wL
ln( 2 ) is called the damping constant. This function is very slow
wG
to compute due to the infinite integral.
LabTalk script access: voigt(xc, A, wG , wL)
PsVoigt2
2 wL
y = A ⋅ mu ⋅ ⋅
π 4( x − xc )2 + wL 2
4 ln 2 − wG 2 ( x − xc )
4 ln 2 2
+ (1 − mu) ⋅ ⋅e
π wG
Pseudo-Voigt function, type 2.
A: Amplitude
xc: Center
wG : Full Gaussian width at half maximum
wL : Full Lorentzian width at half maximum
mu: Profile shape factor
Gaussian and Lorentzian can have different widths.
LabTalk script access: PsVoigt2(xc, A, wG, wL, mu)
2Γ( m) ⋅ 2
1 −m
−1 m
21/ m − 1 2
y = A⋅ ⋅ 1 + 4 ⋅ ⋅ ( x − xc )
π Γ( m − 12 ) w w 2
PearsonVII function.
A: Area
xc: Center
w: Full width at half maximum
m: Profile shape factor
LabTalk script access: Pearson7(xc, A, w, m)
Asym2Sig
y = A⋅
1
⋅ 1−
1
−
x − xc + w1 / 2
−
x − xc − w1 / 2
1+ e w2 1 + e w3
Asymmetric double sigmoidal function.
A: Amplitude
xc: Center
w1 : Width 1
w2 : Width 2
w3 : Width 3
LabTalk script access: Asym2Sig(xc, A, w1, w2, w3)
Weibull3
1
x − xc w2 − 1 w2
S= +
w1 w2
1− w2
w −1
w − 1 −[ S ]
w2
w2 + 2
y = A⋅ 2 [S ] w2 −1
e w2
w2
A: Amplitude
xc: Center
LogNormal
Log Normal Function.
Xc: Center
H: Height
w: Width
LabTalk script access: lognorml(xc, H, w)
GCAS
Gram-Charlier A-Series.
− z2
4
A A
f (x) = e 2 1 + ∑ i H i ( z )
σ 2π i=3 i !
x − rt
z=
σ
rt : Time of peak max; the retention time
A: Peak area
σ: Standard deviation of the peak (sd)
A3 : Skew
A4 : Excess
H3 : z3-3z
H4 : z4-6z3+3
LabTalk script access: gcas(rt, A, sd, A3, A4)
σ 2π 3! 4! 6!
x − rt
z=
σ
rt : Time of peak max; the retention time
A: Peak area
σ: Standard deviation of the peak
A3 : Skew
A4 : Excess
H3 : z3-3z
H4 : z4-6z3+3
H6 : z6-15z4+45z2-15
LabTalk script access: ecs(rt, A, sd, A3, A4)
CCE
Chesler-Cram equation.
− ( x − C4 ) ]
[ )]
2
f ( x ) = C1 e
2 C5
(
+ 1 − 0.5 ⋅ 1 − tanh( C2 ( x − C3 )) ⋅ C6 ⋅ e [
−0.5 C7 x − C8 + ( x − C8 )
C1 : Peak height
C4 : Time of peak max; the retention time
C5 : Standard deviation of the peak.
LabTalk script access: cce(C4, C1, C5, C2, C3, C6, C7, C8)
else
/ 2σ 2 2
f ( x) = He − ( x −rt )
2
InvsPoly
A
y=
x − xc x − xc x − xc
2 4 6
1 + A1 ⋅ 2 ⋅ + A2 ⋅ 2 ⋅ + A3 ⋅ 2 ⋅
w w w
Inverse polynomial function.
A: Amplitude
xc: Center
w: Width
A1: Coefficient
A2: Coefficient
A3: Coefficient
When A1 = 1, A2 = 0, A3 = 0, this function is Lorentzian. When A1 = 1,
A2 = 1/2, A3 = 1/6, this function approximates a Gaussian.
LabTalk script access: InvsPoly(xc, A, w, A1, A2, A3)
Sine
See "Sine" on page 92.
SineDamp
See "SineDamp" on page 92.
Power2
y = A ⋅ x − xc for x < xc
p1
y = A ⋅ x − xc for x > xc
p2
xc: Center
A: Amplitude
p1: Left exponent
p2: Right exponent
LabTalk script access: Power2(xc, A, p1, p2)
Pulse
p
−
x − xc
− x − xc
y = A ⋅ 1 − e t 1 e t 2
xc: Center
A: Amplitude
t1: Parameter 3
t2: Parameter 4
p: Parameter 5
LabTalk script access: Pulse(xc, A, t1, t2, p)
SineDamp
−
x
x − xc
y = A⋅e t0 ⋅ sin( π ⋅ )
w
A: Amplitude
xc: Center
w: Width
t0: Decay time
LabTalk script access: SineDamp(xc, A, w, t0)
Sine
x − xc
y = A ⋅ sin( π ⋅ )
w
A: Amplitude
xc: Center
w: Width
LabTalk script access: Sine(xc, A, w)
SineSqr
x − xc
y = A ⋅ sin 2 ( π ⋅ )
w
A: Amplitude
xc: Center
w: Width
LabTalk script access: SineSqr(xc, A, w)
Line
y = A+ B⋅x
A: Intercept
B: Slope
LabTalk script access: Line(A, B)
Parabola
y = A + B ⋅ x + C ⋅ x2
LabTalk script access: Parabola(A, B, C)
Cubic
y = A + B ⋅ x + C ⋅ x2 + D ⋅ x3
LabTalk script access: Cubic(A, B, C, D)
Poly4
y = A0 + A1 ⋅ x + A2 ⋅ x 2 + A3 ⋅ x 3 + A4 ⋅ x 4
LabTalk script access: Poly4(A0, A1, A2, A3, A4)
Poly5
y = A0 + A1 ⋅ x + A2 ⋅ x 2 + A3 ⋅ x 3 + A4 ⋅ x 4 + A5 ⋅ x 5
LabTalk script access: Poly5(A0, A1, A2, A3, A4, A5)
ExpDec2
x x
− −
y = Y 0 + A1 ⋅ e t1
+ A2 ⋅ e t2
ExpGrow1
x
y = Y0 + A⋅e t0
ExpGrow2
x x
y = Y 0 + A1⋅ e + A2 ⋅ e
t1 t2
Hyperbl
A1 ⋅ x
y = Y0 +
A2 + x
A rectangular hyperbola function.
LabTalk script access: Hyperbl(Y0, A1, A2)
Introduction
You can increase control over Origin and the PFM by using Origin’s
built-in scripting language, LabTalk. Scripting also allows you to build
custom systems. The PFM adds a new set of methods and properties into
LabTalk, which accommodates all of the functionality of the PFM.
Methods are LabTalk commands that perform an action, like creating a
residual plot. Properties are similar to variables. The configuration file
EASYPEAK.CNF uses LabTalk to set up the PFM. You can use this file
as an example of programming the PFM.
Note: When assigning text to text properties, enclose the text in
quotation marks " ".
98 • Basic PFM Scripts: Getting Started Programming the PFM with LabTalk
example, pf.func$="gaussian" sets the Gaussian function as the
fitting function for all peaks in the fitting dataset. You can use the
pf.selFitFunc( ) method to select an existing fitting function or define a
new function.
----
pf.nParan Read/write, numeric. The number of parameters for the nth
peak. When n is equal to 0, the number of parameters of the baseline is
used.
----
pf.nPeaks Read/write, numeric. The number of peaks on the fitting
dataset. For example, pf.nPeaks=5 specifies that there are five peaks in
the fitting dataset.
----
pf.pn Read/write, numeric. The nth parameter value of the current
peak (given by pf.curPeak). n must be within 1 and pf.nParan. You
can use this property to initialize the parameters or get the fitted
parameters.
----
pf.vn Read/write, numeric. The fixed/vary status of the nth parameter
of the current peak (given by pf.curPeak). Use pf.vn = 0 to fix the nth
parameter to its current value so that it will not be modified during
fitting. Use pf.vn = 1 to allow the nth parameter to vary.
----
pf.w$ Read/write, string. The weighting dataset. The weighting
dataset designates the contributions from individual data points. There
are four types of weighting which are described under the pf.wType
method.
----
pf.wType Read/write, numeric. The weighting type for the fitting
datasets. 0: no weight; 1: instrumental weight; 2: statistical weight; 3: a
specified dataset for weighting. Use pf.w$ to assign a weighting dataset.
----
pf.x$ Read/write, numeric. The X column of the dataset to be fitted by
the PFM. This column corresponds to the independent variable of the
fitting functions. If you have already used pf.y$, there is no need for
pf.x$ (unless you want a different X column). However, pf.y$ must be
used to specify a Y column before pf.x$ is used to specify a non-default
X column.
----
pf.y$ Read/write, string. The Y column of the dataset to be fitted by
the PFM. This column corresponds to the dependent variable of the
fitting functions. You must set this column before beginning any fitting
operations. The PFM automatically assigns the corresponding X column,
Programming the PFM with LabTalk Basic PFM Scripts: Getting Started • 99
so setting the pf.x$ property is not necessary unless you want to assign
another column to be the X column.
Example: pf.y$="data1_y" specifies that the column named Y in the
Data1 worksheet is the dataset to be fitted.
pf.editPara(n) Open the Edit Fitting Parameters dialog box to edit the
parameters of the nth peak.
----
pf.fit(n) Perform n rounds of Levenberg-Marquardt fitting. If the
tolerance value (pf.tolerance) is satisfied, the PFM stops before the
specified number of iterations are finished. If n = -1, the PFM fits up to
pf.nIter rounds. For information on pf.tolerance and pf.nIter, see
"Controlling the PFM" on page 104.
----
pf.init( ) Initialize the PFM. All system variables are set to the default
values.
----
pf.selFitFunc(cntrl, n) Open the Select Fitting Function dialog box.
You can choose a function from the Available Functions list or define a
new one.
cntrl = All: Set up a fitting function for all peaks.
cntrl = Peak: Set up a fitting function for peak n.
cntrl = Base: Set up a fitting function for the baseline.
----
pf.unInit( ) Un-initialize the PFM.
Getting Results
After the fitting is done, the fitting results can be found with the
following methods and properties.
pf.areaDn Read only, numeric. The actual area under a fit peak based
on the data. Some peaks may have longer tails that extend beyond the
data range, thus the actual area under the data is less than a whole peak
given by pf.arean.
----
Constraints
Sometimes there are relations between parameters. Constraints allow
such relations to be specified.
Constraints - Properties
Constraints - Methods
Customization - Properties
Customization - Methods
Programming the PFM with LabTalk Auxiliary Methods and Properties • 109
modify the corresponding offset parameter value to reflect this change.
cntrl=2: Adjust the dataset yData to have average height value.
----
pf.dispCurve(cntrl, n) Display function plots with current parameter
values.
cntrl=A: Add a function plot FitFunc_fn for the nth peak into the
current layer.
cntrl=R: Remove FitFunc_fn from the current layer.
When n = -1, this method adds or removes function plots for all peaks.
----
pf.integrate( ) Find the area between the fitting data and the baseline.
----
pf.make(cntrl, xMode, n, xData, yData, nPoints, x1, x2) This
method creates function datasets, or confidence/prediction bands. There
are eight arguments in this method. Some of these arguments may be
ignored (and therefore can be left blank) depending on the first two
arguments cntrl and xMode.
cntrl: Determines what to do.
C: Create confidence bands. Leave yData argument blank. Datasets
FitFunc_LConf and FitFunc_UConf are generated to internally store
the bands.
P: Create prediction bands. Leave yData argument blank. Datasets
FitFunc_LPred and FitFunc_UPred are generated to internally store the
bands.
B: Create both confidence and prediction bands. Leave yData argument
blank.
F: Create a function set with all valid peaks included.
G: Create a function set for the current peak (given by pf.curPeak, see
"Basic PFM Scripts: Getting Started" on page 97).
H: Create a function set for the current peak (given by pf.curPeak)
with a baseline added.
xMode: Determines how to use X values to generate datasets.
0: Use the X values of the dataset that is to be fitted. Leave xData,
nPoints, x1, and x2 arguments blank.
1: Generate a dataset based on nPoints, x1, and x2. x1 is the X starting
value, x2 is the X incremental step size. Leave xData argument blank.
2: Generate a dataset based on a given X dataset xData. xData must
exist before this operation. Leave nPoints, x1, and x2 arguments blank.
3: Generate a dataset that is spaced uniformly in X values. The first and
last X values are the same as those of the fitting dataset, and there are a
total of nPoints points. The spacing between each pair of points is (x2-
x1)/(nPoints-1). Leave xData, x1, and x2 arguments blank.
4: Generate a dataset that is spaced uniformly in the X-direction on the
screen. This is done after the X axis scale is set. However, the actual
spacing in X is not uniform. This will generate a visually uniform curve
on the screen. The first and last X values are the same as the first and
110 • Auxiliary Methods and Properties Programming the PFM with LabTalk
last of the fitting dataset, and there are a total of nPoints pairs of data
points in datasets xData and yData. Leave x1 and x2 arguments blank.
5: Same as above, except the first X value is x1 and the last X value is
x2.
n: When cntrl = F, this determines which dataset is to be generated.
Otherwise, n tells which function is to be generated. n must be within 0 -
pf.nPeaks. For information on pf.nPeaks, see "Basic PFM Scripts:
Getting Started" on page 97.
xData: The X column for the function dataset. May be ignored in some
cases as described above.
yData: The Y column for the function dataset. May be ignored in some
cases as described above.
nPoints: Total points to be generated. May be ignored in some cases as
described above.
x1: The beginning X value. May be ignored in some cases as described
above.
x2: The step size or the last X value. May be ignored in some cases as
described above.
Examples:
pf.make(g, 5, 1, , fitfunc, 100, , ); creates a function dataset fitfunc
for peak 1 with 100 points, which corresponds to the X values of the
fitting data.
pf.make(c, 6, 1, bands_x, , 100, 0.0, 1000.0); creates a confidence
band with band curves (bands_x, FitFunc_LConf) and (bands_x,
FitFunc_UConf).
----
pf.makeBase(xData, yData, n) When you draw an arbitrary line as
the baseline (pf.bType = 12 and pf.bType = 13), this method converts
the user-drawn line (xData, yData) with n points to the baseline datasets
(baseLine_a, baseLine), which are used in the actual computations. You
should not use these datasets (baseLine_a, baseLine) for other purposes.
You can change the baseline datasets by assigning them using the
pf.bColX$ and pf.bColY$ properties. For information on pf.bType,
pf.bColX$, and pf.bColY$, see "Basic PFM Scripts: Getting Started"
on page 97.
----
pf.makeCurve(cntrl, n) Make a function plot with the current
parameter values.
cntrl=g: Create a function plot (without a baseline) named FitFunc_fn
for the nth peak.
cntrl=h: Create a function plot (with a baseline) named FitFunc_fn for
nth peak.
cntrl=f: Create a fit curve named FitFunc_fit with all functions and a
baseline.
Programming the PFM with LabTalk Auxiliary Methods and Properties • 111
cntrl=c: Create a confidence band (FitFunc_lconf, FitFunc_uconf) for
the fit curve FitFunc_fit. Use n = 1.
cntrl=p: Create a prediction band (FitFunc_lpred, FitFunc_upred) for
the fit curve FitFunc_fit. Use n = 1.
When n = -1, this method creates function plots for all peaks.
----
pf.paraInit(n, xData, yData) Given a dataset (xData, yData), this
method can quickly determine the parameters of peak n. When n=0, it
works on the baseline. In general, only nPara pairs of XY values are
needed to determine the parameters of a function with nPara parameters.
The PFM finds or approximates the parameter values according to them.
Although xData and yData may have more than nPara points, only the
first nPara pairs will be used. This method can find the initial
estimations of the parameters. This is useful if you have drawn a line
with nPara points to approximate the actual function.
----
pf.peakGuess(option, i, n) Perform parameter initialization.
option = P: Make estimates for more than one peak or baseline.
option = S: Make estimates for a single peak or baseline.
i = 0: Make estimates for all peaks and baseline.
i = 1: Make estimates for all peaks. Do not make estimates for the
baseline.
n: The number of peaks.
----
pf.plotBase(cntrl, xData, yData) According to the parameters of the
baseline function, this method creates a baseline dataset (xData, yData)
with the number of points equal to the number of parameters of the
baseline.
cntrl=0: Put dataset (xData, yData) into the current layer.
cntrl=1: Create dataset (xData, yData).
cntrl=2: Create dataset (xData, yData) and set the xData values
uniformly.
cntrl=3: Create dataset (xData, yData) and set values for both xData and
yData.
cntrl=4: Set values for yData.
----
pf.plotChar(i, xData, yData, cntrl) For each function with n
parameters, n XY points can determine the parameters in general. These
points are the characteristic points of a function. This method calculates
the values of these points for the function of peak i.
cntrl =1: Create n X values uniformly according to the fitting dataset,
and then generate n Y values according to them. The X values are put
into dataset xData, the Y values into yData.
cntrl =0: You need to provide X values in xData and the Y values are
calculated according to X. Then yData is plotted into the current layer
112 • Auxiliary Methods and Properties Programming the PFM with LabTalk
with filled red circle symbols. The points on this curve can be moved
using the Origin macro mvpts. The macro is accessed by typing:
mvpts WorksheetName_Col (ENTER)
in the Script window.
----
pf.simplex(n) Perform n Simplex iterations. Iterates to find
parameters using the simplex method, according to the specified number
of iterations. When there is no way to guess the parameter values at the
beginning, the simplex method can be used to initialize them or make a
reasonable guess. The simplex method typically needs more functional
evaluations to reach the minimum.
Properties
Programming the PFM with LabTalk Fitting Multiple Datasets Simultaneously • 113
pf.dataStepn Read/write, numeric. The step size of the nth dataset.
Defaults to 1.
----
pf.dataWeightn Read/write, numeric. The weight of the nth dataset
in the entire fitting process. This property allows you to specify the
contribution of each dataset when you perform calculations. Defaults to
1.0.
----
pf.nData Read/write, numeric. The number of total datasets to be fit.
The default value is 1. In most cases, there is only one dataset to be fit.
Thus, you rarely use this property. However, you should set this value if
you need to fit several datasets together.
----
pf.SSRn Read only, numeric. The Sum of Squares value for the nth
dataset. Use the pf.SSR property to get the total value of the Sum of
Squares. For information on pf.SSR, see "Getting Results" on page 100.
----
pf.wn$ Read/write, string. Assign the weight dataset to the nth dataset.
See the pf.w$ property for details on assigning a weight dataset ("Basic
PFM Scripts: Getting Started" on page 97).
----
pf.wTypen Read/write, numeric. The weighting method used for the
nth dataset. Defaults to 0. Use the pf.wType property to assign the
weighting type for all datasets. See the pf.wType property for the
weighting types ("Basic PFM Scripts: Getting Started" on page 97).
----
pf.xn$ Read/write, string. Assign the X dataset to the nth dataset. See
the pf.x$ property for details on assigning an X dataset ("Basic PFM
Scripts: Getting Started" on page 97).
----
pf.yn$ Read/write, string. Assign the Y dataset to the nth dataset. See
the pf.y$ property for details on assigning a Y dataset ("Basic PFM
Scripts: Getting Started" on page 97).
114 • Fitting Multiple Datasets Simultaneously Programming the PFM with LabTalk
Cubic function 93
D
Index Data
display as line or scatter 37
finding peaks 51
precondition 37
selecting 35
range 35
selecting peak function 46, 56
smoothing 39
subtract offset 38
2 Degrees of freedom 69, 77
2nd derivative 53 Dependency
parameters 68
Derivative
A displaying second derivative 53
DLL
Action modes 33
external DLL fitting function 95
Adjacent averaging 40
Asym2Sig function 87
Asymmetric double sigmoidal E
function 87
Asymmetrical Gaussian function 90 ECS function 89
Edgeworth-Cramer Series function
89
B EMGauss function 84
Enlarging wizard graph 53
Baseline
Error values
conditioning 44
weighting the data 64
initialization 40
ExpDec1 function 94
modifying points 43
ExpDec2 function 94
selecting fitting function 43
ExpGrow1 function 94
shifting 45
ExpGrow2 function 94
subtracting 45
Exponentially modified Gaussian
BiGauss function 90
function 84
Bounds
constraining parameters 60
F
C FFT filter smoothing 40
Filtering data 39
CCE function 89
Fit curve
Chesler-Cram equation 89
display for each peak 57
Chi-square 69, 77
fixing parameters 59
Coefficient of determination 69, 77
initializing parameters 56
Confidence 69
peak area 70
Confidence bands 63
peak excess 71
Confidence interval
peak gravity center 71
parameters 68
peak maximum 71
Confidence level 63
peak skew 71
Constraints 59, 60
peak variance 71
general linear 61
sharing parameters 60
upper and lower bounds 60
Convolution of functions 50
Correlation coefficient 69, 77
W
Weibull3 function 87
Weighting the data 63
Wizard map
hiding 34