Sei sulla pagina 1di 124

Peak Fitting Module

TM
PFM











OriginLab Corporation










Copyright 2003 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






Peak Fitting Module Contents iii



Contents
Installing the PFM and Getting Started 1
Installing the PFM......................................................................................................................1
Uninstalling the PFM.................................................................................................................2
Entering a Peak Fitting Session..................................................................................................3
Getting Started Using the Wizard ..............................................................................................3
Peak Fitting Wizard Tutorials 5
Introduction................................................................................................................................5
Tutorial 1, Introduction to the Peak Fitting Wizard ...................................................................5
Getting Started.............................................................................................................6
Selecting a Range of Data............................................................................................6
Defining the Baseline ..................................................................................................8
Finding the Peaks.........................................................................................................8
Fine-tuning the Peak Parameters ...............................................................................11
Performing the Fit......................................................................................................13
Reporting the Fitting Results .....................................................................................15
Exiting a Peak Fitting Session ...................................................................................17
Tutorial 2, Analyzing Data with Hidden Peaks........................................................................17
Getting Started...........................................................................................................17
Selecting a Range of Data..........................................................................................18
Defining the Baseline ................................................................................................18
Finding the Peaks.......................................................................................................20
Setting a Parameter's Lower Bound...........................................................................23
Performing the Fit......................................................................................................24
Reporting the Fitting Results .....................................................................................25
Exiting a Peak Fitting Session ...................................................................................25
Tutorial 3, Creating a Customized Wizard...............................................................................25
Getting Started...........................................................................................................26
Stepping Through the Wizard Performing Actions and Hiding Pages ......................27
Saving the Customized Procedure File......................................................................29
Running the Custom Wizard......................................................................................30
Peak Fitting Wizard Reference 31
Introduction..............................................................................................................................31



iv Contents Peak Fitting Module



Initializing the Peak Fitting Wizard .........................................................................................34
Selecting the Peak Data............................................................................................................35
Preconditioning the Data..........................................................................................................37
Initializing the Baseline............................................................................................................40
Defining How the Baseline Points Should be Used to Create a Baseline ................................42
Modifying the Baseline Points...................................................................................43
Fitting the Baseline Points with a Function ...............................................................43
Connecting the Baseline Points with a Line ..............................................................44
Connecting the Baseline Points with a Spline............................................................44
Conditioning the Baseline........................................................................................................44
Scaling the Baseline Along the Y Axis......................................................................45
Subtracting the Baseline From the Peak Data............................................................45
Specifying the Peak Function and Finding the Peaks...............................................................46
Selecting the Peak Function.......................................................................................46
Modifying and Defining New Functions ...................................................................48
Automatically Finding the Peaks ...............................................................................51
Defining Peaks from a Data File................................................................................52
Adding, Modifying, and Deleting Peaks ..................................................................................52
Enlarging a Section of Interest in the Wizard Graph .................................................53
Locating Hidden Peaks ..............................................................................................53
Adding New Peak Markers........................................................................................54
Modifying the X Location of Peak Markers ..............................................................54
Deleting Peak Markers...............................................................................................54
Assigning Peak-specific Functions and Initializing Parameters...............................................55
Selecting the Active Peak ..........................................................................................55
Changing the Function to Fit to the Peak...................................................................56
Optimizing the Initial Parameter Values....................................................................56
Updating the Wizard Graph While Editing the Peak Edit View Box ........................58
Fixing and Sharing Parameters and Setting Constraints ..........................................................58
Fixing or Allowing Parameter Values to Vary ..........................................................59
Sharing Parameters Among Peaks .............................................................................60
Setting the Parameter Constraints ..............................................................................60
Controlling the Fitting Procedure and Performing the Fit........................................................61
Setting the Number of Iterations................................................................................62
Setting the Tolerance .................................................................................................62
Setting Confidence and Prediction Band Levels........................................................63
Varying or Fixing the Baseline ..................................................................................63
Weighting the Data ....................................................................................................63
Starting the Fitting .....................................................................................................64
Checking the Fit By Reviewing the Residuals...........................................................64
Reporting the Results ...............................................................................................................66
Reporting the Fitting Function Parameters and the Fitting Statistics.........................66
Reporting the Peak Characteristics in a Worksheet Report .......................................69
Reporting the Peak Characteristics in a Graph Report...............................................73
Computing and Viewing the Peak Characteristics Interactively................................77
Saving the Peak Locations to an ASCII File..............................................................79
Saving Settings to an Initialization File .....................................................................79
Creating a Custom Wizard.......................................................................................................80



Peak Fitting Module Contents v



Peak and Baseline Function Reference 83
Introduction..............................................................................................................................83
Peak Functions .........................................................................................................................84
Gaussian.....................................................................................................................84
Gauss2 .......................................................................................................................84
EMGauss ...................................................................................................................84
Lorentz.......................................................................................................................85
Voigt ..........................................................................................................................85
PsVoigt1 ....................................................................................................................86
PsVoigt2 ....................................................................................................................86
Pearson7.....................................................................................................................87
Asym2Sig ..................................................................................................................87
Weibull3 ....................................................................................................................87
LogNormal.................................................................................................................88
GCAS ........................................................................................................................88
ECS............................................................................................................................89
CCE ...........................................................................................................................89
BiGauss......................................................................................................................90
InvsPoly.....................................................................................................................90
Sine............................................................................................................................90
SineSqr.......................................................................................................................91
SineDamp ..................................................................................................................91
Power2.......................................................................................................................91
Pulse ..........................................................................................................................91
Periodic Peak Functions...........................................................................................................92
SineDamp ..................................................................................................................92
Sine............................................................................................................................92
SineSqr.......................................................................................................................92
Baseline Functions ...................................................................................................................93
Line............................................................................................................................93
Parabola .....................................................................................................................93
Cubic..........................................................................................................................93
Poly4..........................................................................................................................93
Poly5..........................................................................................................................93
ExpDec1 ....................................................................................................................94
ExpDec2 ....................................................................................................................94
ExpGrow1..................................................................................................................94
ExpGrow2..................................................................................................................94
Hyperbl ......................................................................................................................94
External DLL Functions...........................................................................................................95
Programming the PFM with LabTalk 97
Introduction..............................................................................................................................97
Basic PFM Scripts: Getting Started .........................................................................................97
Getting Results.......................................................................................................................100
Controlling the PFM..............................................................................................................104
Peaks With Different Functions .............................................................................................105



vi Contents Peak Fitting Module



Fitting a Section of a Dataset .................................................................................................106
Constraints .............................................................................................................................107
Auxiliary Methods and Properties..........................................................................................109
Fitting Multiple Datasets Simultaneously ..............................................................................113
Index 115




Installing the PFM and Getting Started Installing the PFM 1



Installing the PFM and
Getting Started
Installing the PFM
To install the PFM, perform the following:
1) Start Origin 7.5.
2) Select Tools:Pack/Unpack OPK Files. This opens the Origin Pack
dialog box.
3) Click the Open button .
4) In the Origin Pack Files dialog box, Look in the PFM subfolder in
the Origin(Pro) program folder.

5) Select the PFM.OPK and click Open (continues on next page).



2 Uninstalling the PFM Installing the PFM and Getting Started




6) Click the Extract button in the Origin Pack dialog box to install
the files.
During the PFM.OPK installation, a PFM button group is added to the
Groups list box on the Button Groups tab of the Customize Toolbar
dialog box (View:Toolbars).
Additionally, the PFM toolbar displays in the Origin workspace. This
toolbar includes one button, the Enter Peak Fitting Session button .
Uninstalling the PFM
To uninstall 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 Tools:Uninstall OPK Files. This opens the Uninstall Opack
dialog box.



Installing the PFM and Getting Started Entering a Peak Fitting Session 3



Uninstalling the PFM

3) Select the Peak Fitting Module from the list box and click Uninstall.
Entering a Peak Fitting Session
You can enter a peak fitting session when either a worksheet or graph is
active. To enter a peak fitting session, click the Enter Peak Fitting
Session button on the PFM toolbar. This button opens the Peak
Fitting wizard with the active dataset displaying in the wizard graph.
Important Note: When the Peak Fitting wizard is open, you should not
activate and begin performing operations in Origin. If you must return to
Origin to perform operations, you should first close the Peak Fitting
wizard.
Getting Started Using the Wizard
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).
The wizard map provides more navigation options than the Next and
Back buttons, as you can skip pages using the wizard map in both the
forward and backward direction. However, when you first start using the
Peak Fitting wizard, you should navigate through the wizard pages in the
sequence provided. As you become familiar with the wizard, you can



4 Getting Started Using the Wizard Installing the PFM and Getting Started



skip and hide pages. For information on skipping and hiding wizard
pages, see "Tutorial 3, Creating a Customized Wizard".
The wizard graph (located on the right side of the wizard) updates as you
make selections and perform actions on the wizard pages. To enhance
the view of the wizard graph, you can maximize the wizard's display.
You can further enhance the wizard graph display by hiding the wizard
map and then maximizing the wizard. To hide the wizard map, right-
click in a blank area of the wizard (for example, next to the Back button)
and select Show Wizard Map from the shortcut menu. This action de-
selects the menu command and hides the wizard map. Now maximize
the wizard to enhance the view of the wizard graph.





Peak Fitting Wizard Tutorials Introduction 5



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.
Tutorial 1, Introduction to the Peak Fitting
Wizard
This tutorial introduces you to the pages and controls on the Peak Fitting
wizard. Using sample data provided with the PFM, you will define a
baseline, automatically find and manually add peaks, fine-tune the initial



6 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



peak parameter values using an interactive display, fit the data, and
customize the peak analysis report.
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
Explorer button on the Standard toolbar to open it.
4) Double-click on the Chromatography Data folder in the Project
Explorer.
5) Activate the Graph3 - GPC Single Channel Chromatogram window
by clicking on the graph's title bar or by double-clicking on the Graph3
icon on the right side of the Project Explorer.
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.
Selecting a Range of Data
When you first open the Peak Fitting wizard, the Choose Data page is
active. You can select a different peak dataset or edit the range of the
currently selected dataset from this page.
1) Click the Select Range button. Data markers display at both ends of
the peak data in the wizard graph. Additionally, the Current Marker
Position group displays on the wizard page showing the current X and Y
values of the active data marker.



Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 7



Selecting a Range of Data

2) Drag the left data marker to approximately X = 3.
3) Drag the right data marker to approximately X = 18.
4) Press ENTER to fix the markers and exit the range selection mode.
The graph updates displaying the selected range. Additionally, the From
and To text boxes update displaying the respective X values.
Completing the Range Selection




8 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



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.
Constant Baseline Selection

3) Click the Next button to advance to the Baseline Conditioning page.
This page provides controls to scale the baseline along the Y axis or to
subtract the baseline from the peak data.
4) Click the Next button to advance to the Peak Finding page.
Finding the Peaks
The Peak Finding page provides controls to select the peak function and
estimate the peak locations.
1) With the Threshold Height radio button selected in the Find Peaks
group, click the Pick Peaks button. Eight peaks are found and marked
with magenta vertical lines in the wizard graph.



Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 9



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.



10 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



Enlarging a Section of the Wizard Graph

4) Click the Add button and then double-click to define the two peak
locations.
Manually Adding Peaks

5) Click the Done button.
6) 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



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.
Adding the Remaining Peak

Fine-tuning the Peak Parameters
1) Click the Next button to advance to the Peak Edit Control page.
This page provides controls to select the active peak and the function to
fit to that peak. It also provides an interactive peak edit view box,
allowing you to fine-tune the peak parameter values for the active peak
graphically.
The peak edit view box displays the active peak data as black scatter
points. The theoretical curve for the entire dataset displays as a red line
plot. The theoretical curve for the active peak displays as a green line
plot (this may be hidden from view by the composite theoretical curve).
Both theoretical curves are based on the current parameter values and the
selected fitting function(s). Three controls are provided to graphically



12 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



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.
Selecting the Active Peak

3) Click once on the peak to activate it.
The peak edit view box on the left side of the wizard updates displaying
the currently selected peak and theoretical curves.



Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 13



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

Performing the Fit
1) Click the Next button to advance to the Fit page.
This page allows you to edit several quantitative properties of the fitting
procedure, as well as the confidence and prediction levels, and then
perform the fit.



14 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



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.
Performing the Fit

3) Click the Individual Peaks button located below the wizard
graph to display the fit curves for the individual peaks. These fit curves
display as green line plots.



Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 15



Displaying the Fit Curves for the Individual Peaks

Reporting the Fitting Results
1) Click the Next button to advance to the Results page.
This page provides controls to create reports on the fitting function
parameters, fitting statistics, and the peak characteristics. Both
worksheet and graph reports are available.
2) Click the Confidence Bands button and the Prediction Bands
button located below the wizard graph to display confidence and
prediction bands. (The confidence levels are specified on the Fit page.)
Note: When confidence bands, prediction bands, and individual peaks
are displayed in the wizard graph, they will also be included in a graph
report.
3) In the Peak Characterization Report group, click the Options button
located to the right of the Plot button. This opens the Peak
Characterization Report Field Details dialog box.
4) Select 8 from the Total Number of Fields drop-down list.
5) Select "Peak report field 8" in the Available Fields on Report Plot list
box.
6) Select the Resolution with Next Adjacent Peak radio button in the
Available Results for Display group.
(To view the results associated with report fields 1 - 7, select the desired
report field from the Available Fields on Report Plot list box. The radio



16 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials



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.
The Peak Fitting Graph Report

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.



Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 17



The fitting function parameters worksheet report is created in the Origin
project. Because the wizard remains active, the worksheet displays
behind the wizard.
Exiting a Peak Fitting Session
1) Click the Finish button to close the Peak Fitting wizard and access the
graph and worksheet reports.
Tutorial 2, Analyzing Data with Hidden
Peaks
This tutorial introduces you to the Peak Fitting wizard's baseline and
peak detection algorithms. Using sample data provided with the PFM,
you will automatically find the baseline and fit the points with a line
function, automatically find peaks and compare the results with the
second derivative, set a parameter's lower bound, and perform the fit.
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.



18 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials



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.
Selecting a Range of Data

Defining the Baseline
1) Click the Next button to advance to the Precondition Data wizard
page.
2) Click the Next button to advance to the Baseline Points page.
3) Select the Auto Find radio button.
The Auto Find baseline detection algorithm looks for points in the
smoothed first and second derivatives that are within a threshold of zero.
Notice that at the current threshold level, a baseline point is detected on a
peak.
Spin buttons are provided to scale the threshold up or down, thus
increasing or decreasing the number of points found.
4) Click the Number of Points down spin button once.
The wizard graph updates displaying the resultant baseline points. At
this threshold level, the point on the peak is no longer detected.



Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 19



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.
Fitting the Baseline Points with a Line Function

6) Click the Next button to advance to the Baseline Conditioning wizard
page.



20 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials



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.
Finding Peaks Automatically

3) Click the 2nd Derivative button on the wizard to display the
second derivative below the peak and baseline graph layer.



Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 21



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).
Area to Enlarge with the Enlarger Tool




22 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials



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.
Finding Additional Hidden Peaks




Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 23



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.
Manually Adding Peaks

10) Click the Done button.
11) Click the Next button to advance to the Peak Edit Control wizard
page.
Setting a Parameter's Lower Bound
You can set simple constraints for parameters such as lower and upper
bounds, as well as general linear constraints. In this example, you will
set a lower bound for the second peak's area parameter. You will set this
lower bound to zero to prevent the area from going negative during the
iterative procedure.
1) Click the Parameter Display button on the wizard to open the
Peak Parameters Display dialog box.



24 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials



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.
Setting the Lower Bound for a Parameter

4) Click the OK button to close the dialog box.
Performing the Fit
1) Click the Next button to advance to the Fit wizard page.
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 less than 10 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.
3) Click the Individual Peaks button located below the wizard
graph to display the fit curves for the individual peaks.



Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 25



Performing the Fit

Reporting the Fitting Results
1) Click the Next button to advance to the Results page.
2) In the Peak Characterization Report group, click the Plot button.
3) In the Fitting Function Parameters group, click the Worksheet button.
Note: The graph and worksheet report are created in the Origin project.
Because the wizard remains active, the graph and worksheet display
behind the wizard.
Exiting a Peak Fitting Session
1) Click the Finish button to close the Peak Fitting wizard and access the
graph and worksheet reports.
Tutorial 3, Creating a Customized Wizard
As you use the Peak Fitting wizard to analyze different sets of data, you
may find that for each dataset, you perform no actions on some wizard
pages and that you perform the same actions on other wizard pages. For



26 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials



example, perhaps you never precondition your data or apply a smoothing
filter, and thus you perform no actions on the Precondition Data page.
Similarly, perhaps you always use the wizard's baseline finding algorithm
on the Baseline Points page.
If you step through the wizard pages in a similar way when analyzing
data, you can simplify the wizard by hiding pages that you either perform
no actions on or ones that you always perform the same actions on. You
can then save this customized wizard to a new toolbar button for future
access. This tutorial steps you through the process of creating a
customized wizard.
Note: For a list of wizard actions that can be saved to a custom wizard,
see Peak Fitting Wizard Reference.
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.



Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 27



Full View Mode

Stepping Through the Wizard
Performing Actions and Hiding Pages
The first wizard page, Choose Data, allows you to select a range of data.
It also allows you to initialize settings in the Peak Fitting wizard from an
initialization file. If you do not require the range selection feature for
your peak analysis, and if you do not read an initialization file, then you
can hide this wizard page from view.
Note: If you want to read an initialization file, then you should not hide
this page from view.
1) Click in the Choose Data check box on the wizard map to clear the
check box.
Clearing a Check Box on the Wizard Map




28 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials



This action sets the Choose Data page as hidden when you exit the
wizard's Full View mode. Additionally, after you save your customized
wizard to a button, this wizard page will not display when you click your
custom button. Furthermore, no actions on this page will be performed
when this page is skipped.
2) Click in the Precondition Data check box on the wizard map to clear
the check box. This action activates the page and also sets it as hidden
when you exit the wizard's Full View mode. No actions on this page will
be performed when this page is skipped.
3) Click in the Baseline Points check box on the wizard map to clear the
check box. This action activates the page and sets this page as hidden
when you exit the wizard's Full View mode.
4) Click the Auto Find radio button on the Baseline Points wizard page.
Baseline points are found using the wizard's baseline finding algorithm.
When this page is skipped when you run your customized wizard, the
wizard will automatically perform the Auto Find baseline finding
algorithm.
5) Click in the Create Baseline check box on the wizard map to clear the
check box. This action activates the page and sets this page as hidden
when you exit the wizard's Full View mode.
Note that the Create Baseline radio button on the Create Baseline wizard
page is selected, and that the Use Function radio button is selected with
the line function active. When this page is skipped, the wizard will
automatically create the baseline by using the line function.
6) Click in the Baseline Conditioning check box on the wizard map to
clear the check box. This action activates the page and also sets it as
hidden when you exit the wizard's Full View mode. No actions on this
page will be performed when this page is skipped.
7) Click in the Peak Finding check box on the wizard map to clear the
check box. This action activates the page and sets this page as hidden
when you exit the wizard's Full View mode.
8) With the Threshold Height radio button selected in the Find Peaks
group, click the Pick Peaks button. The wizard's peak detection
algorithm finds and marks four peaks in the wizard graph. When this
page is skipped, the wizard will automatically find and mark peaks using
the peak finding algorithm.
9) Click in the Define Peaks check box on the wizard map to clear the
check box. This action activates the page and also sets it as hidden when
you exit the wizard's Full View mode. No actions on this page will be
performed when this page is skipped.
10) Click on the "Peak Edit Control" text in the wizard map (not in the
check box). This action activates the page but does not change its view
status.
11) Click on the "Fit" text in the wizard map. This action activates the
page but does not change its view status.



Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 29



12) 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).
13) Click on the "Results" text in the wizard map. This action activates
the page but does not change its view status.
Saving the Customized Procedure File
1) On the Results page, select the Save Procedure File check box.
2) Right-click in the blank gray area of the wizard next to the Help
button. This action opens a shortcut menu.
3) Select View Mode:Normal from the shortcut menu. The wizard map
updates displaying the Peak Edit Control, Fit, and Results wizard page
icons.
The Updated Wizard Map

4) Click the Finish button. This action opens the Button Settings dialog
box.



30 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials



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.
Running the Custom Wizard
1) To run your custom Peak Fitting wizard, make sure that Graph5 is
still active and then click the new toolbar button you just created.
(You are re-analyzing Graph5 because replicate datasets are not available
in this project file. You would typically activate a new graph window
containing similar data.)
Your custom wizard will open displaying the Peak Edit Control wizard
page. The baseline is already created and the four peaks are already
marked.
2) Click the Next button to advance to the Fit page.
3) Click the Fit button to perform, at most, 10 Levenberg-Marquardt
iterations.
4) Click the Next button to advance to the Results page.
5) In the Fitting Function Parameters group, click the Worksheet button.
6) Click the Finish button to close the custom Peak Fitting wizard and
access the worksheet report.



Peak Fitting Wizard Reference Introduction 31



Peak Fitting Wizard
Reference
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).
The Peak Fitting wizard includes the following pages:
Choose Data: This page contains controls for selecting the Y fitting
dataset and for selecting a range of data for fitting. You can also select
an initialization file on this page. For more information on the dataset
controls, see "Selecting the Peak Data" on page 35. For more
information on initialization files, see "Initializing the Peak Fitting
Wizard" on page 34 and "Saving Settings to an Initialization File" on
page 79.
Precondition Data: This page allows you to precondition and apply a
smoothing filter to your data prior to fitting. For more information on
this wizard page, see "Preconditioning the Data" on page 37.
Baseline Points: This page is the first step in specifying the baseline
before fitting your data. Edit this page to select the baseline points. For
more information on this wizard page, see "Initializing the Baseline" on
page 40.
Create Baseline: After you have selected the baseline points from the
Baseline Points wizard page, edit this page to specify how the baseline



32 Introduction Peak Fitting Wizard Reference



points will be used to create the baseline. This page also provides
controls for adding, modifying, or deleting baseline points before
creating the baseline. For more information on this wizard page, see
"Defining How the Baseline Points Should be Used to Create a Baseline"
on page 42.
Baseline Conditioning: This page allows you to condition the baseline
before fitting. You can scale the baseline along the Y axis or subtract the
baseline from your peak data. For more information on this wizard page,
see "Conditioning the Baseline" on page 44.
Peak Finding: This page contains controls to specify the peak function
and estimate the peak locations. For more information on this wizard
page, see "Specifying the Peak Function and Finding the Peaks" on page
46.
Define Peaks: After defining the peak function and finding the peaks,
edit this page to add, modify, or delete peaks. For more information on
this wizard page, see "Adding, Modifying, and Deleting Peaks" on page
52.
Peak Edit Control: Edit this page to set a different function for
different peaks, and to visually adjust the theoretical curve to get the best
initial parameter values. For more information on this wizard page, see
"Assigning Peak-specific Functions and Initializing Parameters" on page
55.
Fit: This page allows you to control the fitting procedure and perform
the fit. For more information on this wizard page, see "Controlling the
Fitting Procedure and Performing the Fit" on page 61.
Results: This page allows you to create reports on the fitting function
parameters and the fitting statistics, as well as on the peak characteristics.
Additionally, this page provides an option for saving the current fitting
variable values and parameter values to an initialization file, as well as
for saving the wizard page actions to a procedure file. For more
information on the result reports, see "Reporting the Results" on page 66.
For more information on initialization files and procedure files, see
"Initializing the Peak Fitting Wizard" on page 34 and "Saving Settings to
an Initialization File" on page 79, and "Creating a Custom Wizard" on
page 80.
The following buttons are available on the Peak Fitting wizard:
Opens a dialog box for manually initializing the parameter values,
fixing parameter values, sharing parameters among peaks, and setting
parameter constraints including upper and lower bounds and general
linear constraints. For more information, see "Fixing and Sharing
Parameters and Setting Constraints" on page 58.
Enlarge a section of the wizard graph. For more information, see
"Enlarging a Section of Interest in the Wizard Graph" on page 53.



Peak Fitting Wizard Reference Introduction 33



Scroll the wizard graph axes left and right after enlarging. For
more information, see "Enlarging a Section of Interest in the Wizard
Graph" on page 53.
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 second derivative of the peak data. For more
information, see "Locating Hidden Peaks" on page 53.
Display confidence bands. For more information, see "Setting
Confidence and Prediction Band Levels" on page 63.
Display prediction bands. For more information, see "Setting
Confidence and Prediction Band Levels" on page 63.
Display the theoretical curve for the individual peaks. For more
information, see "Optimizing the Initial Parameter Values" on page 56.
Display the peak data in the wizard graph as a line or scatter
data plot. For more information, see "Selecting the Peak Data" on page
35.
The following shortcut menu commands are available on the Peak Fitting
wizard:
To open the Peak Fitting wizards 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.



34 Initializing the Peak Fitting Wizard Peak Fitting Wizard Reference



Show Wizard Map: The wizard map on the left side of the wizard
provides navigation through the wizard. You can hide the wizard map at
any time by selecting Show Wizard Map from the shortcut menu. When
the wizard map is hidden, use the Next and Back buttons for navigation.
Open Editor: The Open Editor command opens the Peak Fitting
wizards script file in a new instance of the LabTalk Editor. We do not
recommend that you alter the Peak Fitting wizards script file.
Initializing the Peak Fitting Wizard
The Peak Fitting wizard reads a file for initializing the following settings:
1) Peak and baseline characteristics including the number of peaks, the
peak functions, the baseline function, the initial parameter values,
parameter sharing, fixing parameter values, and constraints including
lower and upper bounds and general linear constraints.
2) Report settings including the results for display in the peak
characterization report and the fitting function parameters report.
3) Properties of the fitting procedure (the number of iterations and the
tolerance) and confidence and prediction levels.
The default initialization file is PFM.INI. This file is located in your
Origin folder. When you start the Peak Fitting wizard, this initialization
file is selected by default on the Choose Data wizard page and is read
when the wizard is opened. You can select a different initialization file
by clicking the Read button and selecting the file.
The last page of the Peak Fitting wizard, the Results page, provides a
control for writing to the PFM.INI file or to a custom initialization file
that you specify. This control is available by clicking the Save button in
the Initialization File group. When you click the Save button and specify
an INI file (either PFM.INI or a custom file), the peak and baseline
characteristics (1) and the report settings (2) are saved to the INI file.
The properties of the fitting procedure and confidence and prediction
levels (3) are always saved to the INI file currently selected to write to,
independent of whether you click the Save button.
Thus, after you analyze a peak dataset with the Peak Fitting wizard, you
can save your current settings to an initialization file. Then when you
select a similar dataset for analysis, you can select this custom file for
initializing the wizard.



Peak Fitting Wizard Reference Selecting the Peak Data 35



Selecting the Peak Data
The Choose Data wizard page contains controls for selecting the Y peak
dataset and for selecting a range of data for fitting.
Note: For information on initialization files, see "Initializing the Peak
Fitting Wizard" on page 34.
The Choose Data Wizard Page Controls

The Dataset Drop-down List
This drop-down list contains all the Y datasets in the current project. If
you open the wizard with a worksheet active that has a Y column
selected, or if a graph with data is active, the Y worksheet column
(dataset) or the Y dataset of the active data plot is automatically selected
from this drop-down list. To specify a different Y dataset for peak
fitting, select it from the drop-down list. When you select a Y dataset,
the Peak Fitting wizard automatically finds the associated X dataset,
respecting column associations in the worksheet.
When a Y dataset is selected from this drop-down list, the dataset and its
associated X dataset are plotted in the wizard graph.
The Select Range Button
Click this button to define a range of data for peak analysis. After
clicking this button, data markers display at both ends of the data plot
and the Data Selector tool is activated in the wizard graph. Additionally,
a Current Marker Position group displays on the wizard page.



36 Selecting the Peak Data Peak Fitting Wizard Reference



The Current Marker Position Group

Selecting a Range of Data

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.
The Full Range Button
Click this button to select the full range of the dataset selected in the
Dataset drop-down list. If you previously selected a range of the dataset,
clicking this button will reset the data markers to the entire range.
Note: If you have used the Edit:Set As Begin and Set As End menu
commands to set the worksheet display range before starting the PFM
session, or if you set the graph display range using the Data Selector tool



Peak Fitting Wizard Reference Preconditioning the Data 37



and the Data:Set Display Range menu command before starting the
PFM session, the wizard's Full Range button will not override these
range settings.
The From and To Text Boxes
These text boxes display the current starting and ending X data values for
your range selection. In addition to customizing the data range using the
Select Range button, you can customize the range by typing the desired
starting and ending X values in the text box provided. After typing in a
value, press TAB to update the text box and view your change in the
wizard graph.
Displaying the Peak Data as a Line or Scatter Data Plot
With any page of the peak fitting wizard active, you can change between
a scatter and a line peak data plot in the wizard graph by clicking the
Line Plot or the Scatter Plot button located in the wizard
graph.
Preconditioning the Data
The Precondition Data wizard page allows you to precondition and apply
a smoothing filter to your data prior to fitting.
The Precondition Data Wizard Page Controls




38 Preconditioning the Data Peak Fitting Wizard Reference



The Data Preconditioning Group
Click the View Options button to precondition your data prior to fitting.
This button opens the Precondition Fitting Dataset dialog box.
The Precondition Fitting Dataset Dialog Box

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.



Peak Fitting Wizard Reference Preconditioning the Data 39



8) Shirley baseline subtraction (1). Subtract the data using the Shirley
method (see Note below). R1 and R2 are the minimum and maximum
row numbers that correspond to the energy range. N0 is the required
final baseline height. Note that this operation is slow.
9) Shirley baseline subtraction (2). Subtract the data using the Shirley
method (see Note below). E1 and E2 designate the energy range. N0 is
the required final baseline height. Note that this operation is slow.
10) Tougaard baseline subtraction (1). Subtract the data using the
Tougaard method. R1 and R2 are the minimum and maximum row
numbers that correspond to the energy range. B1 is an adjustable
parameter. Note that this operation is slow.
11) Tougaard baseline subtraction (2). Subtract the data using the
Tougaard method. E1 and E2 designate the energy range. B1 is an
adjustable parameter. Note that this operation is slow.
12) Tougaard baseline subtraction (3). Subtract the data using the
Tougaard method. R1 and R2 are the minimum and maximum row
numbers that correspond to the energy range. N0 is the required final
baseline height. Note that this operation is slow.
13) Tougaard baseline subtraction (4). Subtract the data using the
Tougaard method. E1 and E2 designate the energy range. N0 is the
required final baseline height. Note that this operation is slow.
14) Straight-line baseline subtraction (1). Subtract the data using the
Straight-line method. R1 and R2 are the minimum and maximum row
numbers that correspond to the energy range. N0 is the required final
baseline height. Note that this operation is slow.
15) Straight-line baseline subtraction (2). Subtract the data using the
Straight-line method. E1 and E2 designate the energy range. N0 is the
required final baseline height. Note that this operation is slow.
Note: For reference information on the Tougaard baseline subtraction
method, see S. Tougaard, Surf. Sci. 216, 343 (1989). For reference
information on the Shirley baseline subtraction method, see D. A.
Shirley, Phys. Rev. B5, 4709 (1972). For a review of both methods, see
S. Tougaard and C. Jansson, "Comparison of Validity and Consistency of
Methods for Quantitative XPS Peak Analysis", Surf. Interface Anal. 20,
Issue 13, 1013.
To perform the preconditioning method, click the Run button. When
finished editing this dialog box, click the OK button.
The Filters Group
Select a smoothing filter method from the Filters drop-down list.
1) Select Savitsky-Golay to smooth the data using the Savitsky-Golay
filter method. Specify the degree of the underlying polynomial from the
Polynomial Order spin box. Specify the size of the smoothing window
from the Points to the Left and the Points to the Right spin boxes. (You



40 Initializing the Baseline Peak Fitting Wizard Reference



can make the smoothing window asymmetric about a particular data
point.)
Note: To use this smoothing filter method, the X data must be evenly
spaced.
2) Select Adjacent Averaging to smooth the data using adjacent
averaging. Specify a number that controls the degree of smoothing in the
associated text box. If you enter an odd number n, then n points are used
to calculate each averaged result. If you enter an even number m, then
m+1 points are used to calculate each averaged result. The smoothed
value at index i is the average of the data points in the interval [i-(n-1)/2,
i+(n-1)/2], inclusive.
3) Select FFT Filter to smooth the data by FFT filtering. Specify the
number of points at a time to be considered by the smoothing routine in
the associated text box. The smoothing is accomplished by removing
Fourier components with frequencies higher than 1/(n deltat), where n is
the number of data points considered at a time and deltat is the time (or
more generally the abscissa) spacing between adjacent data points.
After selecting the smoothing filter, click the Run Filter button to
perform the operation.
The Restore Data Button
Click this button to undo any preconditioning or smoothing filter that you
applied to the data.
Initializing the Baseline
The Baseline Points wizard page is the first step in specifying the
baseline before fitting your data. Edit this page 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 PFM's baseline finding
algorithm.
If you graphically define the baseline points, use an existing dataset, or
use the wizard's baseline finding algorithm, then after initializing the
baseline points, select the Create Baseline wizard page to specify how the
baseline points will be used to create the baseline. The Create Baseline
wizard page is unavailable if you select a constant for the baseline.



Peak Fitting Wizard Reference Initializing the Baseline 41



The Baseline Points Wizard Page Controls

Selecting the Baseline Points
There are four methods for selecting the baseline points:
1) Select the Constant radio button to specify two baseline points
determined by the Y = text box value. The two baseline points are:
(XBegin, Y=Value) and (XEnd, Y=Value).
Note: If you select this radio button, then the Create Baseline wizard
page is not available.
2) Select the Auto Find radio button to find baseline points based on the
wizard's internal baseline detection algorithm. This algorithm looks for
points in the smoothed first and second derivatives that are within a
threshold of zero. Up and down arrow buttons are provided to scale the
threshold up (by 2) or down (by 0.5), thus increasing or decreasing the
number of points found. Each time you click the up or down arrow
button, the wizard graph updates displaying the resultant baseline points.
3) Select the User Defined radio button to define baseline points using
the Screen Reader tool. After selecting this radio button, the Screen
Reader tool is activated in the wizard graph and 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 define a baseline point, double-click
at the desired location or click once and press ENTER. When finished
defining 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.



42 Defining How the Baseline Points Should be Used to Create a Baseline Peak Fitting Wizard Reference



Note: To delete the current user defined baseline points, click the
Recreate button. In addition to deleting the current baseline points
selection, this button re-activates the Screen Reader tool in the wizard
graph.
4) Select the Use Existing Dataset radio button to specify a dataset to use
as the baseline points from the associated drop-down list. The drop-
down list includes all Y datasets in the project, except for the peak
dataset and associated fitting datasets (if any have been created).
Defining How the Baseline Points Should
be Used to Create a Baseline
After you have initialized the baseline points from the Baseline Points
wizard page, edit the Create Baseline wizard page to specify how the
baseline points will be used to create the baseline. You can also use this
page to add, modify, or delete baseline points.
Note: If you selected the Constant radio button on the Baseline Points
wizard page, then the Create Baseline wizard page is not available.
The Create Baseline Wizard Page Controls




Peak Fitting Wizard Reference Defining How the Baseline Points Should be Used to Create a Baseline 43



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.
Fitting the Baseline Points with a
Function
Select the Create Baseline radio button to specify how the baseline points
will be used to create the baseline.
Select the Use Function radio button and then select a fitting function
from the drop-down list. The following baseline functions are provided:
Line Poly5 ExpGrow2
Parabola ExpDec1 Hyperbl
Cubic ExpDec2
Poly4 ExpGrow1



44 Conditioning the Baseline Peak Fitting Wizard Reference



For more information on these functions, see "Peak and Baseline
Function Reference".
Connecting the Baseline Points with a
Line
Select the Create Baseline radio button to specify how the baseline points
will be used to create the baseline.
Select the Connect Points with Line radio button to display a straight line
between consecutive baseline data points.
Connecting the Baseline Points with a
Spline
Select the Create Baseline radio button to specify how the baseline points
will be used to create the baseline.
Select the Connect Points with Spline radio button to connect the
baseline data points with a cubic spline connection.
Note: This radio button is unavailable if the number of points in the peak
dataset exceeds 900.
Conditioning the Baseline
After you have created the baseline, edit the Baseline Conditioning
wizard page to shift the baseline along the Y axis or to subtract the
baseline from the peak data.
The Baseline Conditioning Wizard Page Controls




Peak Fitting Wizard Reference Conditioning the Baseline 45



Scaling the Baseline Along the Y Axis
Click the Scale Baseline button to shift the baseline along the Y axis at a
specified location on the peak data plot. After clicking the Scale
Baseline button, the Data Display tool opens and a Current Marker
Position group displays on the wizard page. As you click on data points
on the peak data plot in the wizard graph, the associated XY values
display in the Current Marker Position group. Double-click at the
desired location or click once and press ENTER. Origin finds the
corresponding Y value for the baseline data at this same X value. Origin
then calculates the difference between the peak Y value and the baseline
Y value and adds this amount to the entire baseline.
Subtracting the Baseline From the
Peak Data
In deciding whether or not to subtract the baseline from your peak data,
you should consider the relative number of peaks in the peak data, as
well as the complexity of the baseline.
In general, if there are a large number peaks in your peak data, or if the
baseline is very complex, it may be best to subtract the baseline from the
peak data prior to fitting the peak data. If you don't subtract the baseline
from the peak data, but instead fit the baseline with the peak data
(allowing the baseline to vary), smaller peaks that are close to the
baseline could cause the baseline to stray during the fitting process.
Additionally, small differences in the peak shape in your peak data
versus the model could cause the baseline to stray during the fitting
process.
Subtracting the baseline also reduces the number of dimensions in the
parameter space that the chi-square minimization algorithm has to work
with, and this may improve the quality of the fit.
The main advantage of fitting the baseline along with the peak data is to
avoid any additional errors that could be introduced in the fitting process
by the baseline subtraction process. When the baseline is fit along with
the peaks, the fitting model describes all of the data, and is therefore a
statistically complete fit.



46 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference



Specifying the Peak Function and Finding
the Peaks
After creating and conditioning the baseline, edit the Peak Finding
wizard page to specify the peak function and estimate the peak locations.
Note: You can specify a different function for different peaks on the
Peak Edit Control wizard page. For more information, see "Assigning
Peak-specific Functions and Initializing Parameters" on page 55.
The Peak Finding Wizard Page Controls

Selecting the Peak Function
Click the Set/Modify button to select a fitting function to fit the peak
data. You can either select a built-in function, a user-defined function, or
a modified built-in or user-defined function. After editing the associated
dialog boxes and returning to the Peak Finding wizard page, the function
name displays in the associated view box.
The Set/Modify button opens the Select Fitting Function dialog box.



Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 47



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:
Gaussian Asym2Sig Sine
Gauss2 Weibull3 SineSqr
EMGauss LogNormal SineDamp
Lorentz GCAS Power2
Voigt ECS Pulse
PsVoigt1 CCE DLL_Func *
PsVoigt2 BiGauss
Pearson7 InvsPoly
* Note: DLL_Func is a sample peak fitting function provided in an
external DLL. For more information on using external DLL functions,
see "Peak and Baseline Function Reference".
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.



48 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference



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.



Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 49



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.
Selecting the Function Form
There are three forms of user-defined functions available in the Define
New Peak Function dialog box:
Expression: f(x)
Script: y=f(x)
Conv: y=f(t)*g(x-t)
----
1) Expression
Define your function in an expression format such as:
Y0+A*X+B*X*X
where Y0, A and B are parameters, and X is the independent variable.
User-defined functions of this form are fast.
----
2) Script
This form allows you to define functions with multiple lines and
intermediate variables such as:
temp1=A*X;
temp2=B*X*X;
Y=temp1+temp2+C;
where temp1 and temp2 are temporary variables. Y is the dependent
variable. The advantage of this form is that you can easily define a large
function.
The following example defines a peak function which is a modified
version of the Gaussian function.
y
A
w
e
x xc
w
B
x xc
w
=

|
\

|
.
| +
|
\

|
.
|

(
(

2
2
2 4

a. Type MyFunc in the Name text box.
b. Select "Script y=f(x)" from the Form drop-down list.
c. Type in the following function definition in the Fitting Function
Definition text box:
temp1=(X-XC)/W;
temp2=temp1*temp1;
Y=A*exp(-2*(temp2+B*temp2*temp2))/(W*sqrt(PI/2));
Temp1 and temp2 are temporary variables.



50 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference



d. In the Names text box for the "Other3" parameter, type B.
e. In the Init. Values text box for B, type 0.05.
f. In the L. Bounds text box for B, type 0.
g. Make sure that the Use Area in Definition check box is selected as A
is the area in this definition.
h. Click the Save button and then click the OK button to close the dialog
box.
The MyFunc function is now available from the Available Functions list
box in the Select Fitting Function dialog box.
----
3) Convolution
New fitting functions can be defined that are convolutions of built-in
functions. The following example defines a function that is a
convolution of a Lorentzian and Gaussian function (i.e. a Voigt function).
a. Type MyConv in the Name text box.
b. Select "Conv y=f(t)*g(x-t)" from the Form drop-down list.
c. Type in the following function definition in the Fitting Function
Definition text box:
%func1=gaussian(0,A,wG); /*%func1 is a placeholder.*/
%func2=lorentz(xc,1,wL);
y=conv(-100,+100,%func1,%func2,1.0e-3);
In this example, Gaussian and Lorentz are two built-in functions which
take three parameters each. In this instance, the independent variable is
implicit. Note that for a function defined as a convolution of two
functions, certain parameters must be given simplifying values. In this
example, the Gaussian peak center is set to zero and the Lorentzian area
to 1. This is to avoid over-parameterization of the function. Though
'[-100,+100]' was chosen as the X range for the convolution in this
example, any range could be used up to a maximum range of
[-1.0e-60,1.0e60]. The last argument in the conv( ) function (1.0e-3) is
the degree of precision used in evaluating the convolution.
d. Change the name of the Width parameter from w to wG.
e. In the Names text box for the "Other3" parameter, type wL.
f. In the L. Bounds text box for wL, type 0.
g. Make sure that the Use Area in Definition check box is selected as A
is the area in this definition.
h. Click the Save button and then click the OK button to close the dialog
box.
The MyConv function is now available from the Available Functions list
box in the Select Fitting Function dialog box.



Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 51



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.
Assigning Initial Parameter Values
Type the initial parameter values in the Init. Values text boxes provided.
Use these values to initialize the fitting function.
Defining the Lower and Upper Bounds
Type the lower and upper bounds for the parameters in the L. Bounds
and U. Bounds text boxes provided. The wizard always presets some
bounds for the parameters of peak functions. For example, the area (A)
and width (w) always have greater-than-zero lower bounds.
Defining the Fitting Function
Type the definition of the fitting function in this text box.
Saving the Function
Press the Save button to save the current dialog box settings to the
function definition file. Additionally, the function is added to the
Available Functions drop-down list in the Select Fitting Function dialog
box.
Automatically Finding the Peaks
Click the Pick Peaks button to find positive and negative peaks in the
peak data. Peaks are marked by vertical green lines in the wizard graph.
These peak locations provide an estimate of the peak's center and height,
which is used for the initial parameter values during the fitting.
Note: You can add, modify, and delete defined peaks on the next wizard
page (Define Peaks).
1) When the Threshold Height 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 peaks that are
above a noise threshold. The noise threshold is the standard deviation of
the original peak data, and 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.)



52 Adding, Modifying, and Deleting Peaks Peak Fitting Wizard Reference



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
enlarge a section of your data. To do this, click the Enlarger button
located below the wizard graph and drag a region of interest in the wizard
graph. Buttons are also available to scroll the X axis and to restore the
full axes scale. For a complete discussion of these buttons, see "Adding,
Modifying, and Deleting Peaks" on page 52.
To delete the peak markers, click the Clear All button.
Defining Peaks from a Data File
To use a dataset (that is saved as an ASCII file) to define peak locations
in your peak data, click the Read button in the Peak Centers and Heights
group. This button opens the Read Peak Centers and Heights dialog box.
After selecting your file and clicking the Open button, the wizard graph
updates marking the peaks based on the data file's XY values.
This option is most useful when performing peak fitting on similar
datasets. After performing peak fitting on the first dataset, the Results
wizard page provides a button for saving the peak centers and heights to
an ASCII file. Then when you analyze the next (similar) dataset, click
the Read button to access the previously saved peak centers and heights
for determining the current dataset's peak markers.
For more information on saving peak centers and heights to an ASCII
file, see "Saving the Peak Locations to an ASCII File" on page 79.
Adding, Modifying, and Deleting Peaks
After defining the peak function and finding the peaks using the wizard's
internal peak finding algorithm or an ASCII data file, edit the Define
Peaks wizard page to add, modify, or delete peaks.



Peak Fitting Wizard Reference Adding, Modifying, and Deleting Peaks 53



The Define Peaks Wizard Page Controls

Enlarging a Section of Interest in the
Wizard Graph
Before adding, modifying, or deleting peak markers in the wizard graph,
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
and Scroll Right buttons located next to the Enlarger button.
To return to the full axes scale, click the Rescale button on the
wizard.
Locating Hidden Peaks
The wizard's internal peak finding algorithm (on the Peak Finding wizard
page) is designed to locate hidden peaks, as it searches the smoothed
second derivative of the peak data. If you prefer to skip this peak finding
algorithm and locate your peaks (including hidden peaks) manually, or if
the peak finding algorithm did not mark all hidden peaks, the wizard
provides a 2nd Derivative button to assist you. Click this button to
display the second derivative in a graph layer below the peak data. The
points where the second derivative reaches a minimum represent points
of inflection in the peak data, and may be indicative of small or hidden
peaks. The Enlarger button is available to enlarge a section of the
second derivative or a section of the peak data.



54 Adding, Modifying, and Deleting Peaks Peak Fitting Wizard Reference



After turning on the display of the second derivative, click the Add
button to define new peaks. The Add button activates the Screen Reader
tool in the wizard graph. Using the second derivative as a guide, double-
click to fix a peak location. For more information on defining new peak
locations, see "Adding New Peak Markers" on page 54.
To turn off the display of the second derivative, click a second time on
the 2nd Derivative button.
In addition to viewing the second derivative to help locate hidden peaks,
after you perform a fit (on the Fit wizard page) you can click the
Residuals button to review the residual plot. The residual plot
represents the difference between the fit curve and the actual data points.
Non-marked hidden peaks will usually display as peaks in the residual
plot. For more information, see "Controlling the Fitting Procedure and
Performing the Fit" on page 61.
Adding New Peak Markers
Click the Add button to define new peak locations in the peak data. 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
define a peak marker, double-click at the desired location or click once
and press ENTER. Recall that the peak locations provide an estimate of
the peak's center and height, which is used for the initial parameter
values during the fitting. When finished defining peak markers, click the
Done button.
Modifying the X Location of Peak
Markers
To modify the location of a peak marker, drag the peak marker line to the
desired location. After you drag and click off of a marker, the Current
Marker Position group displays on the wizard page, displaying the
current X location of the marker.
Deleting Peak Markers
Click the Delete button to delete a peak marker from the peak data. To
delete a peak marker, click once on the peak marker line. When finishing
deleting peak markers, click the Done button.



Peak Fitting Wizard Reference Assigning Peak-specific Functions and Initializing Parameters 55



Assigning Peak-specific Functions and
Initializing Parameters
When you activate the Peak Edit Control wizard page, a theoretical curve
(red line plot) displays in the wizard graph, reflecting the currently
selected function to fit to each peak and the initial parameter values for
each peak function. Edit this wizard page to set a different function for
different peaks, and to visually adjust the theoretical curve to get the best
initial parameter values.
The Peak Edit Control Wizard Page Controls

Selecting the Active Peak
Activate a peak by selecting the desired peak number from the Peak
Number drop-down list. You can also double-click on the current drop-
down list selection and type the desired peak number. Peaks are
enumerated from left to right in the dataset.
You can also select the active peak by clicking on the peak in the wizard
graph. As you move the mouse over the wizard graph, the mouse pointer
displays as a hand pointer, allowing you to click to select a peak.



56 Assigning Peak-specific Functions and Initializing Parameters Peak Fitting Wizard Reference



Selecting the Active Peak in the Wizard Graph

Changing the Function to Fit to the
Peak
To change the function to fit to the selected peak, select the new function
from the Change Function drop-down list. When you select a new
function, the view box below the Peak Edit Control group updates to
reflect the selected function. The selection you make in this dialog box
effects only the selected peak, not the entire dataset.
For information on the available functions, see "Peak and Baseline
Function Reference".
Optimizing the Initial Parameter
Values
The peak edit view box on this wizard page includes the following:
1) Active peak data: black symbols.
2) Theoretical curve for the entire dataset: red line.
3) Theoretical curve for the selected (individual) peak: green line.
4) Controls to adjust the height, width, and center of the theoretical
curve for the selected peak.
The theoretical curve for the selected peak is based on the specified peak
function and the default parameter values. You can change the height,
width, and center of the theoretical curve by dragging one of the red
crossbars to the desired position (height and center) or by dragging one
of the sizing handles on the theoretical curve in the view box (width of



Peak Fitting Wizard Reference Assigning Peak-specific Functions and Initializing Parameters 57



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
button located below the wizard graph.
Note: If the theoretical curve for the individual peaks display in the
wizard graph, then they are also included in the graph report accessible
from the Results wizard page.



58 Fixing and Sharing Parameters and Setting Constraints Peak Fitting Wizard Reference



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
enlarge the peak. To do this, click the Enlarger button located
below the wizard graph and drag a rectangle around the peak in the
wizard graph. Buttons are also available to scroll the X axis and to
restore the full axes scale. For a complete discussion of these buttons,
see "Adding, Modifying, and Deleting Peaks" on page 52.
Updating the Wizard Graph While
Editing the Peak Edit View Box
Select the Update Graph when Params. Change check box to update the
wizard graph whenever a change is made in the peak edit view box. If
this check box is cleared, click the Redraw button to make the changes to
the wizard graph.
Fixing and Sharing Parameters and Setting
Constraints
The Peak Parameters Display dialog box (which is accessed by clicking
the Parameter Display button below the wizard graph) allows you to



Peak Fitting Wizard Reference Fixing and Sharing Parameters and Setting Constraints 59



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.
The Peak Parameters Display Dialog Box

Changing the Peak Function
To change the function to fit to the selected peak, double-click on the
current function in the Peak Type column. This action opens a drop-
down list containing the available peak functions. Select the new
function from the drop-down list.
Editing Parameter Values
To initialize a parameter to a pre-set value, double-click on the current
parameter value in the Value column and then type the desired value.
To return the parameter value to the previous setting, click the Refresh
button.
Fixing or Allowing Parameter Values
to Vary
To prevent a parameter from varying during the iterative procedure,
select the parameter's Fix check box.



60 Fixing and Sharing Parameters and Setting Constraints Peak Fitting Wizard Reference



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.
Sharing Parameters Among Peaks
To share parameter values between peaks (for example, the Width
parameter), select the Share check box for each of the peak parameters
you want to share. For example, to share the Width parameter among
peaks 2 and 4 in your data plot, select the Share check box for the Width
parameter for both peak 2 and peak 4. If a parameter is shared between
peaks, there will be only one common version for the specified peaks.
Setting the Parameter Constraints
You can set simple constraints for parameters such as lower and upper
bounds. To set a bound, select the LBound or UBound check box for the
respective parameter. Then double-click on the current Lower Bound or
Upper Bound value and type the desired constraint.
In addition to setting the lower and upper bounds, you can set general
linear constraints. To do this, click the Constraints button on the Peak
Parameters Display dialog box. This button opens the Set General Linear
Constraints dialog box.
Setting General Linear Constraints

Enter the constraints in the text box provided. If there is more than one
constraint, separate constraints by a semicolon (;). To enter constraints



Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit 61



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.
Controlling the Fitting Procedure and
Performing the Fit
The Fit wizard page allows you to control the fitting procedure and
perform the fit.



62 Controlling the Fitting Procedure and Performing the Fit Peak Fitting Wizard Reference



The Fit Wizard Page Controls

Setting the Number of Iterations
Specify the maximum number (n) of Levenberg-Marquardt iterations to
perform when the Fit button is clicked. If the tolerance is reached or an
error occurs before n iterations have been performed, then less than n
iterations will be performed. The number of iterations actually
performed is displayed in the output view box (below the Weighting
Method group).
Setting the Tolerance
When you click the Fit button, this causes the Peak Fitting wizard to try
to perform, at most, n Levenberg-Marquardt iterations of reduced chi-
square, where n is the Iterations value. If the relative change of the
reduced chi-square value between two successive iterations is less than
the Tolerance value, then no more iterations are performed.



Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit 63



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.
Varying or Fixing the Baseline
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.
You can fix the baseline parameters by selecting the Fix Baseline
Parameters check box on the Fit wizard page, or by selecting the baseline
parameter's Fix check boxes in the Peak Parameters Display dialog box
(which is accessed by clicking the Parameter Display button ).
Weighting the Data
The Peak Fitting wizard allows you to specify how different data points
are to be weighted when computing the reduced chi-square value during
the iterative process. The available weighting methods are:



64 Controlling the Fitting Procedure and Performing the Fit Peak Fitting Wizard Reference



1) No weight. The weight for each data point = . The sum of
squares =
1 =
i
w


2
) (
i i
f y .
2) Statistical. The weight for each data point = . The
sum of squares =
2 / 1
/ 1
i i
y w =


i i i
y f y / ) (
2
.
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 = , where
i i
w / 1 =
i
is the error size for each data point
as specified in the selected error dataset. The sum of squares =
. [ ]
2
/ )
i i
f (


i
y
4) Specified Dataset. This option is only available if the worksheet
containing the peak data includes a Y error column. The weight for each
data point = , where d is the specified dataset value for
each data point. The sum of squares =
i i
d w / 1 =
i
[ ]
2
/ ) (


i i i
d f y .
Starting the Fitting
Click the Fit button to perform, at most, n Levenberg-Marquardt
iterations, as specified in the Number of Iterations drop-down list (and
the Tolerance text box). For a discussion on the relationship between the
Number of Iterations drop-down list value and the Tolerance text box
value, see "Setting the Tolerance" on page 62.
After performing the Levenberg-Marquardt iterations, the reduced chi-
square value and the actual number of iterations performed are listed in
the Output view box. To view the updated parameter values, click the
Parameter Display button to open the Peak Parameters Display
dialog box.
Note: To reset the parameters to their values when first activating this
page, click the Reset button.
Checking the Fit By Reviewing the
Residuals
After you perform a fit you can click the Residuals button located
below the wizard graph to review the residual plot. The residual plot
represents the difference between the fit curve and the actual data points.



Peak Fitting Wizard Reference Controlling the Fitting Procedure and Performing the Fit 65



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.
Non-Marked Hidden Peak Revealed by Residuals

Marked Hidden Peak and Residuals

If you locate hidden peaks by reviewing the residuals, return to the
Define Peaks wizard page and add a peak marker for the hidden peak.
Then proceed to the Peak Edit Control page and fine-tune the parameter
values using the peak edit view box. Finally, proceed back to the Fit
page and perform additional fitting iterations.



66 Reporting the Results Peak Fitting Wizard Reference



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.
The Results Wizard Page Controls

Reporting the Fitting Function
Parameters and the Fitting Statistics
To select parameter value details that will be saved to a worksheet, click
the Options button in the Fitting Function Parameters group of the
Results wizard page. This button opens the Fitting Function Parameter
Report Details dialog box.



Peak Fitting Wizard Reference Reporting the Results 67



The Fitting Function Parameter Report Details Dialog Box

In addition to the fitting function parameter values, you can select to
report the following:
1) The standard error on the parameter value.
2) The dependency of the parameter.
3) The parameter confidence interval.
Once you have selected the parameter details to report, click the OK
button. To save these parameter details to a worksheet named Paramn,
click the Worksheet button in the Fitting Function Parameters group.
The Peak Fitting wizard will increment n each time a new Param
worksheet is created in the Origin project. The Param worksheet will not
be in view after clicking the Worksheet button, as the Peak Fitting wizard
remains active. To view the worksheet, minimize or close the wizard
(before closing, review the wizard initialization and procedure file
concepts reviewed in "Saving Settings to an Initialization File" on page
79 and "Creating a Custom Wizard" on page 80). The Param worksheet
will be active if this is the last results worksheet you created. Otherwise,
it can be activated from the workspace, from Project Explorer, or the
Window menu.



68 Reporting the Results Peak Fitting Wizard Reference



The Param Worksheet

For each peak, the Param worksheet reports:
1) The parameter name.
2) The parameter value obtained in the fitting process.
3) The standard error on the parameter value.
4) The confidence interval. This is calculated based on a large-sample
approximation using the standard error and the critical value of the
standard normal distribution for the given confidence level.
5) The dependency of the parameter (a value very close to 1 indicates
strong dependency, and therefore, over parameterization).
Additionally, the Param worksheet reports:
1) SS: Sum of squares of difference between the data and the fit.

=
=
end
begin
i i
i i
i i i
y f w S
2
) ( ) (
where is the function value evaluated for data point i , is the
weight, and is incremented by i . The PFM implements the
i
f
i
w
i
step



Peak Fitting Wizard Reference Reporting the Results 69



Levenberg-Marquardt algorithm to find the parameters to minimize
) ( S . The weight specifies the contribution from data point i . For
information on the weighting methods, see "Controlling the Fitting
Procedure and Performing the Fit" on page 61.
i
w
n
S
eff
(
2

2) Reduced ChiSqr: Reduced chi-square value of fit.


p d
S

=
) ( ) (
)
where ) ( S is the sum of squares value (see item 1), is the parameter
vector, is the degree of freedom, is the number of data points used
in the fit, and
d n
p is the number of varying parameters in fitting.
3) COD: Coefficient of Determination (R^2).
4) Correlation: Correlation coefficient (R).
5) DOF: Number of degrees of freedom, which is the number of data
points considered minus the number of floating parameters (parameters
that were not fixed).
6) NPoints: Number of data points considered in the fitting process.
7) Confidence: Confidence level used in calculating the prediction
bands.
8) Tolerance: Tolerance value to stop iterations.
Reporting the Peak Characteristics in
a Worksheet Report
Peak characterization reports can be generated in the form of a worksheet
or a graph. Both reports are available from the Peak Characterization
Report group on the Results wizard page.
To create a worksheet report, first click the Options button that is located
to the right of Worksheet button in the Peak Characterization Report
group. This button opens the Peak Characterization Report Details
dialog box.



70 Reporting the Results Peak Fitting Wizard Reference



The Peak Characterization Report Details Dialog Box

To include a peak characteristic in the report, select the associated check
box. The following peak characteristics are available. When selected,
the peak characteristic is reported for each peak in your peak data.
1) Fitted peak area. Integrate to find the area between the peak function
and the baseline using the parameter values obtained from the fit. The
integration is performed from to . (In the ReportWks
worksheet, this column is named AreaFit.)
+
2) Fitted peak area contained in fitting range. Integrate to find the area
between the peak function and the baseline using the parameter values
obtained from the fit. The integration is performed within the data range
only. (In the ReportWks worksheet, this column is named AreaFitT.)
3) Fitted peak area contained in fitting range (%). Integrate to find the
area between the peak function and the baseline using the parameter
values obtained from the fit. The integration is performed within the data
range only. The result is expressed as a percent of the total area. (In the
ReportWks worksheet, this column is named AreaFitTP.)
4) Peak area by integrating data. Integrate to find the area between the
peak data and the baseline. The integration is performed within the data
range only. (In the ReportWks worksheet, this column is named
AreaIntg.)



Peak Fitting Wizard Reference Reporting the Results 71



5) Peak area by integrating data (%). Integrate to find the area between
the peak data and the baseline. The integration is performed within the
data range only. The result is expressed as a percent of the total area. (In
the ReportWks worksheet, this column is named AreaIntgP.)
6) Location for peak maximum height. The X value for the peak
maximum. (In the ReportWks worksheet, this column is named
CenterMax.)
7) Peak gravity center. The X value of the peak center of gravity ( ' ).
See item 14. (In the ReportWks worksheet, this column is named
CenterGrvty.)
1
m
8) Peak maximum height. The Y value for the peak maximum. (In the
ReportWks worksheet, this column is named MaxHeight.)
9) Full width at half maximum. The peak width at half the peak's
maximum value. (In the ReportWks worksheet, this column is named
FWHM.)
10) Peak variance. Variance of the data, which is the second moment
( m ). See item 14. (In the ReportWks worksheet, this column is named
Variance.)
2
11) Peak skew. Fisher skewness, which is a measure of the degree of
asymmetry of the peak.
3
2
3
m
m
S = (In the ReportWks worksheet, this
column is named Skew.)
12) Peak excess. Fisher kurtosis, measures the long-tailedness or
peakedness of the peak relative to the normal or Gaussian distribution
with the same mean and variance. 3
2
2
4
=
m
m
E (In the ReportWks
worksheet, this column is named Excess.)
13) Resolution with next adjacent peak.
) ( 5 . 0
1 2
1 2
w w
X X
R
c c
s
+

=
2
w
, where
and are peak centers, and and are constructed base
widths. (In the ReportWks worksheet, this column is named
Resolution.)
1 c
X
2 c
X
1
w
14) Peak moments. (In the ReportWks worksheet, these columns are
named Moment3 and Moment4.)

=
0
0
) ( dx x F m (0th moment or the area of the peak)

=
0
0
) (
1
' dx x x F
m
m
n
n
where (nth zero-point moment) 1 n



72 Reporting the Results Peak Fitting Wizard Reference


=
0
1
0
) ' )( (
1
dx m x x F
m
m
n
n
where (nth central moment) 2 n
15) Width at n% of peak maximum. The peak width at n% of the peak's
maximum value. (In the ReportWks worksheet, this column is named
WidthAtP.)
16) Area above n% of peak maximum. The peak area above the n% of
the peak's maximum value. (In the ReportWks worksheet, this column is
named AreaAbove.)
17) Cumulative area to X relative to center. The cumulative fitted area
from to X, where X is a specified value relative to the peak center.
(In the ReportWks worksheet, this column is named CumArea.)

After completing your selections and clicking the OK button, create your
peak characteristics worksheet report by clicking the Worksheet button in
the Peak Characterization Report group. The Peak Fitting wizard creates
a ReportWksn worksheet. The wizard will increment n each time a new
ReportWks worksheet is created in the Origin project. The ReportWks
worksheet will not be in view after clicking the Worksheet button, as the
wizard remains active. To view the worksheet, minimize or close the
wizard (before closing, review the initialization and procedure file
concepts reviewed in "Saving Settings to an Initialization File" on page
79 and "Creating a Custom Wizard" on page 80). The ReportWks
worksheet will be active if this is the last results worksheet you created.
Otherwise, it can be activated from the workspace, Project Explorer, or
the Window menu.
The ReportWks Worksheet




Peak Fitting Wizard Reference Reporting the Results 73



Reporting the Peak Characteristics in
a Graph Report
In addition to reporting the peak characterization results to a worksheet,
you can generate a graph report. When you create a graph report, the
report will include a graph layer displaying the peak data, the baseline,
and the fit curve. Additionally, if you have enabled the display of
confidence bands, prediction bands, and the fit curves for the individual
peaks in the wizard graph, then these fit results will also display in the
report graph layer. To enable the display of confidence or prediction
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
Individual Peaks button .
To create a graph report, first click the Options button that is located to
the right of Plot button in the Peak Characterization Report group. This
button opens the Peak Characterization Report Details dialog box.



74 Reporting the Results Peak Fitting Wizard Reference



The Peak Characterization Report Field Details Dialog Box

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.



Peak Fitting Wizard Reference Reporting the Results 75



After completing your selections and clicking the OK button, create your
peak characteristics graph report by clicking the Plot button in the Peak
Characterization Report group. The Peak Fitting wizard creates a
ReportPlotn graph. The wizard will increment n each time a new
ReportPlot graph is created in the Origin project. The ReportPlot graph
will not be in view after clicking the Plot button, as the wizard remains
active. To view the graph, minimize or close the wizard (before closing,
review the initialization and procedure file concepts reviewed in "Saving
Settings to an Initialization File" on page 79 and "Creating a Custom
Wizard" on page 80). The ReportPlot graph will be active if this is the
last results graph you created. Otherwise, it can be activated from the
workspace, Project Explorer, or the Window menu.



76 Reporting the Results Peak Fitting Wizard Reference



The ReportPlot Graph
10 12 14 16 18 20 22
2.0x10
0
2.5x10
0
3.0x10
0
3.5x10
0
4.0x10
0
4.5x10
0
5.0x10
0
P
F
M
D
a
t
a
_
B
PFMData_A
Peak Analysis Title
BaseLine: Line
Corr Coef=0.99768
COD=0.99536 # of Data Points=757
Degree of Freedom=700 SS=0.9617170725
Chi^2=0.001373881532
Date:2/15/01 Data Set: PFMData_B Source File: PFMData
Fitting Results
MaxHeight
0.33725
0.12209
0.33423
0.49789
1.03928
1.22964
1.64174
2.13114
0.91653
2.3726
0.81268
1.70922
0.68735
0.07815
0.0467
0.0288
-0.16322
1.75958
-0.04924
AreaFitTP
8.67708
0.87641
1.97704
2.23755
8.26604
6.45849
16.21901
11.02011
5.17421
11.20626
5.60154
8.71965
3.88126
0.53015
0.2515
0.11586
-1.17646
10.33607
-0.37175
FWHM
0.97814
0.27289
0.22488
0.17085
0.30237
0.19968
0.37557
0.19658
0.21462
0.17956
0.26203
0.19394
0.21467
0.25789
0.20475
0.15292
0.27402
0.22332
0.28704
CenterGrvty
12.9929
13.02015
13.23607
13.4174
13.68053
13.96167
14.31949
14.73408
15.00353
15.28102
15.63787
16.03141
16.5979
16.9477
17.96634
18.60927
19.04303
19.76359
20.55382
AreaFitT
0.35114
0.03547
0.08001
0.09055
0.33451
0.26136
0.65634
0.44596
0.20939
0.45349
0.22668
0.35286
0.15706
0.02145
0.01018
0.00469
-0.04761
0.41827
-0.01504

4.04674
Peak Type
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Gaussian
Peak #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

In addition to the peak characteristics specified in the Peak
Characterization Report Field Details dialog box, the ReportPlot graph
also includes the following fitting information and results:
1) Source File: The name of the worksheet that contains the fit data.
The Peak Fitting wizard creates a hidden worksheet named PFMData that
contains the fit data. If additional datasets are fit in the same project, the
wizard increments this worksheet name.
2) Dataset: The Y fit dataset name. For example, PFMData_b.



Peak Fitting Wizard Reference Reporting the Results 77



3) Date: The date that the graph report is created.
4) Chi^2: The reduced chi-square value of the fit. For a definition, see
"Reporting the Peak Characteristics in a Worksheet Report" on page 69.
5) COD: Coefficient of Determination (R^2).
6) # of Data Points: The number of data points used in the fitting.
7) SS: Sum of squares of difference between the data and the fit. For a
definition, see "Reporting the Peak Characteristics in a Worksheet
Report" on page 69.
8) Corr Coef: Correlation coefficient (R).
9) Degree of Freedom: Number of degrees of freedom, which is the
number of data points considered minus the number of floating
parameters (parameters that were not fixed).
Computing and Viewing the Peak
Characteristics Interactively
In addition to displaying the peak characteristics as a worksheet report or
a graph report, the Peak Fitting wizard can compute and display certain
peak characteristics interactively in a dialog box. To do this, click the
View button in the Peak Properties group of the Results wizard page.
This button opens the Peak Characteristics dialog box.



78 Reporting the Results Peak Fitting Wizard Reference



The Peak Characteristics Dialog Box

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



Peak Fitting Wizard Reference Reporting the Results 79



= peak variance, 3rd order = skew or vertical asymmetry, 4th order =
excess.)
Peak inflection points: The locations of the left and right inflection
points.
Peak maximum point: The location of the peak maximum. It may not be
located at peak center of the function definition.
Overlap area: The overlap between two peaks. The area below the
baseline is excluded.
Dataset area between R1 and R2: The area between the dataset and
baseline. Only the section between row R1 and R2 is counted.
Dataset area between X1 and X2: The area between the dataset and
baseline. Only the section between x1 and x2 is counted.
Saving the Peak Locations to an ASCII
File
If you analyze similar datasets with the Peak Fitting wizard, you can save
the current peak locations to an ASCII file to use for peak initialization of
subsequent data. To do this, click the Save button in the Peak Centers
and Heights group on the Results wizard page. This button opens the
Save Peak Centers and Heights dialog box. Specify a file name and click
the Save button.
To use these peak locations for initialization of subsequent data, click the
Read button on the Peak Finding wizard page.
Saving Settings to an Initialization File
If you analyze similar datasets with the Peak Fitting wizard, you can save
the wizard's current peak and baseline settings as well as the report
settings to an initialization file. You can then initialize the wizard from
this initialization file when analyzing subsequent datasets. To save these
settings to an initialization file, click the Save button in the Initialization
File group on the Results wizard page. To initialize the wizard from a
file, click the Read button on the Choose Data page.
The following wizard settings are saved in the initialization file:
1) Peak and baseline characteristics including the number of peaks, the
peak functions, the baseline function, the initial parameter values,
parameter sharing, fixing parameter values, and constraints including
lower and upper bounds and general linear constraints.
2) Report settings including the results for display in the peak
characterization report and the fitting function parameters report.



80 Creating a Custom Wizard Peak Fitting Wizard Reference



Note: The properties of the fitting procedure (the number of iterations
and the tolerance) and confidence and prediction levels are always saved
to the INI file currently selected to write to, independent of whether you
click the Save button.
Creating a Custom Wizard
After you become familiar with the Peak Fitting wizard, you might find
that you consistently perform the same actions on some wizard pages and
no actions on other wizard pages. If you step through the wizard pages in
a similar way when analyzing data, you can simplify the wizard by
hiding pages that you either perform no actions on or ones that you
always perform the same actions on. You can then save this customized
wizard to a new toolbar button for future access. For step-by-step
instructions on creating a custom wizard, see "Tutorial 3, Creating a
Customized Wizard".
To hide a page in the wizard, right-click on a blank section of the wizard
(for example, next to the Help button) and select View Mode:Full. The
Full view mode is a wizard design mode. This view mode allows you to
turn off the display of wizard pages by clearing the associated check box
located on the wizard map.
Now you can step through the wizard specifying which pages you want
to hide.
To hide a page that you never perform any actions on, clear the
associated check box on the wizard map.
To hide a page that you want to perform the same actions on, manually
perform the action on the page (for example, click the Pick Peaks button
on the Peak Finding page) and then clear the page's check box on the
wizard map. When this page is skipped when you run your customized
wizard, the wizard will automatically perform the action.
The following actions can be saved to a custom wizard:
Baseline Points page: Selecting a radio button.
Create Baseline page: Making a selection in the Create Baseline group.
Baseline Conditioning page: Clicking the Subtract Baseline button.
Peak Finding page: Clicking the Pick Peaks button. Selecting a built-in,
modified, or newly defined function in the Peak Type group.
Fit page: Clicking the Fit button.
------
After clearing the desired wizard map check boxes, perform the
following steps to create your custom wizard:
1) On the Results page, select the Save Procedure File check box.



Peak Fitting Wizard Reference Creating a Custom Wizard 81



2) Right-click again on a blank section of the wizard and select View
Mode:Normal from the shortcut menu. The wizard map updates
displaying only the non-hidden pages.
3) Click the Finish button. This action opens the Button Settings dialog
box.
The Button Settings Dialog Box

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.




82 Creating a Custom Wizard Peak Fitting Wizard Reference










Peak and Baseline Function Reference Introduction 83



Peak and Baseline
Function Reference
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.



Peak Functions
Gaussian
( )
y
A
w
e
x xc
w
=


4 2 4 2
2
2
ln( ) ln( )


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.
( )
( )
f x
A
e
x r
t
=

2
2 2
2 /

r
t
: 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.
( ) f x
A
e e
z
x x
G G
x x
z
y
G
G
G
=
=

|
\

|
.
|


1
2
2
2
2
1
2
dy

: Time of peak max. - retention time
A: Peak area
G
: Standard deviation of the peak (sd)
84 Peak Functions Peak and Baseline Function Reference






G
x : Time constant of exponential axis (tc)
LabTalk script access: emgauss(rt, A, sd, tc)
Lorentz
y
A w
x xc w
=
+
2
4
2 2
( )

The Lorentzian function.
xc: Center
A: Peak area
w: Full width at half maximum
LabTalk script access: lorentz(xc, A, w)
Voigt
y A
w
w
e
w
w
x xc
w
t
dt
L
G
t
L
G G
=

|
\

|
.
|
+

|
\

|
.
|

2 2
2 4 2
3 2 2
2 2
2
ln( )
ln( ) ln( )
/


A: Peak area
xc: Center
w
G
: Full Gaussian width at half maximum
w
L
: Full Lorentzian width at half maximum
ln( ) 2
w
w
L
G
is called the damping constant. This function is very slow
to compute due to the infinite integral.
LabTalk script access: voigt(xc, A, w
G
, w
L
)
Peak and Baseline Function Reference Peak Functions 85






PsVoigt1
y A mu
w
x xc w
mu
w
e
w
x xc
=
+

+
(

(
(

2
4
1
4 2
2 2
4 2
2
2

( )
( )
ln
ln
( )

Pseudo-Voigt function, type 1.
A: Amplitude
xc: Center
w: Full width at half maximum
mu: Profile shape factor
Gaussian and Lorentzian have the same width.
LabTalk script access: PsVoigt1(xc, A, w, mu)
PsVoigt2
y A mu
w
x xc w
mu
w
e
L
L
G
w
x xc
G
=
+

+
(

(
(

2
4
1
4 2
2 2
4 2
2
2

( )
( )
ln
ln
( )

Pseudo-Voigt function, type 2.
A: Amplitude
xc: Center
w
G
: Full Gaussian width at half maximum
w
L
: 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)
86 Peak Functions Peak and Baseline Function Reference






Pearson7
( )
( )
y A
m
m w w
x xc
m m
m
=

2 2 1
1 4
2 1
1
1
2
1
2
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
e e
x xc w
w
x xc w
w
=
+

+

(
(
(


1
1
1
1
1
1
2
1
3
2 2 / /

Asymmetric double sigmoidal function.
A: Amplitude
xc: Center
w
1
: Width 1
w
2
: Width 2
w
3
: Width 3
LabTalk script access: Asym2Sig(xc, A, w
1
, w
2
, w
3
)
Weibull3
[ ]
[ ]
S
x xc
w
w
w
y A
w
w
S e
w
w
w
w
S
w
w
w
=

+
|
\

|
.
|
=
|
\

|
.
|

+
|
\

|
.
|
1
2
2
1
2
2
1
1
1
1
1
2
2
2
2
2 2
2

A: Amplitude
xc: Center
Peak and Baseline Function Reference Peak Functions 87






w
1
: Width 1
w
2
: Width 2
LabTalk script access: Weibull3(xc, A, w
1
, w
2
)
LogNormal
Log Normal Function.
y H e
x x w
c
=
( (ln( ) ln( )) /( ))
2 2
2

X
c
: Center
H: Height
w: Width
LabTalk script access: lognorml(xc, H, w)
GCAS
Gram-Charlier A-Series.
f x
A
e
A
i
H z
z
i
i
i
( )
!
( ) = +
|
\

|
.
|

2
1
2
2
3
4

z
x r
t
=


r
t
: Time of peak max; the retention time
A: Peak area
: Standard deviation of the peak (sd)
A
3
: Skew
A
4
: Excess
H
3
: z
3
-3z
H
4
: z
4
-6z
3
+3
LabTalk script access: gcas(rt, A, sd, A3, A4)
88 Peak Functions Peak and Baseline Function Reference






ECS
Edgeworth-Cramer Series.
( ) ( ) ( ) f z
A
e
A
H z
A
H z
A
H z
z
( )
! !
/
= + + +
|
\

|
.
|

2
1
3! 4
10
6
2
2 3
3
4
4
4
2
6

z
x r
t
=


r
t
: Time of peak max; the retention time
A: Peak area
: Standard deviation of the peak
A
3
: Skew
A
4
: Excess
H
3
: z
3
-3z
H
4
: z
4
-6z
3
+3
H
6
: z
6
-15z
4
+45z
2
-15
LabTalk script access: ecs(rt, A, sd, A3, A4)
CCE
Chesler-Cram equation.
( )
( )
( ) ( ) ( )
[ ]
( ) [ ]
f x C e C x C C e
x C
C
C x C x C
= +


+
1
2
2 3 6
0 5
4
2
5
7 8 8
1 0 5 1 . tanh
.
C
1
: Peak height
C
4
: Time of peak max; the retention time
C
5
: Standard deviation of the peak.
LabTalk script access: cce(C4, C1, C5, C2, C3, C6, C7, C8)
Peak and Baseline Function Reference Peak Functions 89






BiGauss
Asymmetrical Gaussian function.
if x < r
t
2
1
2
2 / ) (
) (

t
r x
He x f

=
else
2
2
2
2 / ) (
) (

t
r x
He x f

=
r
t
:: Time of peak max; the retention time
H : Peak height

1
: Left standard deviation of the peak (sd1)

2
: Right standard deviation of the peak (sd2)
LabTalk script access: bigauss(rt, H, sd1, sd2)
InvsPoly
y
A
A
x xc
w
A
x xc
w
A
x xc
w
=
+
|
\

|
.
|
+
|
\

|
.
|
+
|
\

|
.
|
1 1 2 2 2 3 2
2 4 6

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.
90 Peak Functions Peak and Baseline Function Reference






SineSqr
See "SineSqr" on page 92.
SineDamp
See "SineDamp" on page 92.
Power2
y A x xc x xc
y A x xc x x
p
p
= <
= >
1
2
for
for c

xc: Center
A: Amplitude
p1: Left exponent
p2: Right exponent
LabTalk script access: Power2(xc, A, p1, p2)
Pulse
y A e e
x xc
t
p
x xc
t
=
|
\

|
.
|


1
1 2

xc: Center
A: Amplitude
t1: Parameter 3
t2: Parameter 4
p: Parameter 5
LabTalk script access: Pulse(xc, A, t1, t2, p)
Peak and Baseline Function Reference Peak Functions 91






Periodic Peak Functions
The fitting functions in this section are periodic functions. They are used
in the same way as the peak functions with two exceptions:
1) These functions will apply to all peaks when selected.
2) Automatic initialization cannot be performed, so you must initialize
the function parameters.
SineDamp
y A e
x xc
w
x
t
=

0
sin( )
A: Amplitude
xc: Center
w: Width
t0: Decay time
LabTalk script access: SineDamp(xc, A, w, t0)
Sine
y A
x xc
w
=

sin( )
A: Amplitude
xc: Center
w: Width
LabTalk script access: Sine(xc, A, w)
SineSqr
y A
x xc
w
=

sin ( )
2

A: Amplitude
xc: Center
w: Width
LabTalk script access: SineSqr(xc, A, w)
92 Periodic Peak Functions Peak and Baseline Function Reference






Baseline Functions
Line
y A B x = +
A: Intercept
B: Slope
LabTalk script access: Line(A, B)
Parabola
y A B x C x = + +
2

LabTalk script access: Parabola(A, B, C)
Cubic
y A B x C x D x = + + +
2 3

LabTalk script access: Cubic(A, B, C, D)
Poly4
y A A x A x A x A x = + + + + 0 1 2 3 4
2 3 4
5

LabTalk script access: Poly4(A0, A1, A2, A3, A4)
Poly5
y A A x A x A x A x A x = + + + + + 0 1 2 3 4 5
2 3 4

LabTalk script access: Poly5(A0, A1, A2, A3, A4, A5)
Peak and Baseline Function Reference Baseline Functions 93






ExpDec1
y Y A e
x
t
= +

0
0

LabTalk script access: ExpDec1(Y0, A, t0)
ExpDec2
y Y A e A e
x
t
x
t
= + +

0 1 2
1 2

LabTalk script access: ExpDec2(Y0, A1, t1, A2, t2)
ExpGrow1
y Y A e
x
t
= + 0
0

LabTalk script access: ExpGrow1(Y0, A, t0)
ExpGrow2
y Y A e A e
x
t
x
t
= + + 0 1 2
1 2

LabTalk script access: ExpGrow2(Y0, A1, t1, A2, t2)
Hyperbl
y Y
A x
A x
= +

+
0
1
2

A rectangular hyperbola function.
LabTalk script access: Hyperbl(Y0, A1, A2)
94 Baseline Functions Peak and Baseline Function Reference






Peak and Baseline Function Reference External DLL Functions 95



External DLL Functions
External DLLs can be used as fitting functions for peaks. A sample
fitting function DLL (DLL_FUNC.DLL) is included with the PFM,
along with its source code (DLL_FUNC.C), module definition file
(DLL_FUNC.DEF), and its required header file (LABFIT.H). Also
included is a function definition file (DLL_FUNC.PKF) for the one
function which the DLL contains, a simple Gaussian function.
The following steps illustrate the use of this function in the PFM. (Note
that this Gaussian DLL function is already installed for you, but the steps
are included here as an example.)
1) Copy the DLL into your Origin software folder (where the Origin
executable file and the PFM DLL are installed).
2) Copy the function definition file DLL_FUNC.PKF into the Origin
\FITFUNC folder.
3) Edit the PFM.INI file so that the PKF file name (in this case
DLL_FUNC) appears in the appropriate list (PeakFuncList or
BaseFuncList) in the [FittingFunctions] section of PFM.INI.
----
After you complete these steps and restart Origin and the Peak Fitting
wizard, the function displays in the Available Functions list box when
you click the Set/Modify button on the Peak Finding wizard page. Note
that the name of the DLL, the name of the function in the DLL, and the
name of the PKF file are distinct though they are all DLL_FUNC in
this example. That is to say:
1) The DLL name is user-defined. A single DLL may contain many
functions.
2) The name of the function(s) in the DLL are the actual C identifiers
used in the source code to prototype and define the function. This
function name must appear in the EXPORTS section of the module
definition (DEF) file with an ordinal number which is used to refer to the
function.
3) The function definition file (PKF file) must contain the name of the
DLL and the ordinal number of the appropriate function in the NAME
field.
4) The name of the function definition file (PKF file, not the DEF file) is
the name that will appear in the function list box. It is distinct from the
DLL name, or the names of any functions exported in the DLL.
The source code for the sample DLL is commented and can be modified
to provide any function desired.
The function definition file for a DLL function can be modified from the
sample DLL_FUNC.PKF provided, but must comply with the following
requirements:



96 External DLL Functions Peak and Baseline Function Reference



1) The fields NPARAM and PARAMETERS should be edited so the
number of parameters and their names match what is required by the
DLL.
2) The parameters must always be in the order center, area, width,
(others...).
3) Initial values for parameters can be edited in the INITVAL field. To
leave any parameter to be set by the user, place a # in that parameters
position.
4) UPPERBOUND and LOWERBOUND fields can also be edited with
some restrictions. Area and width parameters must have a lower bound
of 0 and center parameters should be left with a !. This instructs the
PFM to determine the bounds for that parameter. In addition, the
parameters can vary during the fitting session.
5) The last element in the OPTIONS field should be set to the keyword
PEAK.
6) All other fields in the PKF file should be left as they are, except for
FORMULA, which can be updated. In the case of DLL functions, the
FORMULA field is merely a description of the function for the users
benefit. For user-defined script functions, this field actually defines the
function and must therefore follow proper LabTalk syntax.




Programming the PFM with LabTalk Introduction 97



Programming the PFM
with LabTalk
Introduction
You can increase control over Origin and the PFM by using Origins
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 " ".
Basic PFM Scripts: Getting Started
These properties and methods allow you to perform peak analysis at a
basic level.
Basic Peak Fitting - Properties
pf.bColY$, pf.bColX$ Read/write, string. The baseline datasets when
pf.bType = 11. In general, you only need pf.bColY$, because the X
column associated with the Y column you select is assigned
automatically.
----



98 Basic PFM Scripts: Getting Started Programming the PFM with LabTalk



pf.bFunc$ Read/write, string. The fitting function for the baseline.
The baseline is the background for peaks. The baseline can be a
function, dataset, or user-drawn-line, as determined by pf.bType.
Note: In addition to many mathematical functions, there are three special
functions:
Dataset (pf.bType = 11): A dataset is used as the baseline. Use
pf.bColY$ and pf.bColX$ to assign the baseline datasets.
FreeForm (pf.bType = 12): A user-drawn line is used as the baseline.
The line is connected by straight line segments. Use the
pf.makeBase( ) method to create an internal baseline dataset. See
"Auxiliary Methods and Properties" on page 109.
Spline (pf.bType = 13): A user-drawn line is used as the baseline. The
line is connected by cubic spline. Use the pf.makeBase( ) method to
create an internal baseline dataset. See "Auxiliary Methods and
Properties" on page 109.
----
pf.bType Read only, numeric. The baseline type:
0: General built-in function.
1: User-defined function of expression form.
2: User-defined function of Y-script form.
3: External DLL function.
5: Built-in peak function used as the baseline.
11: Dataset used as the baseline.
12: FreeForm user-drawn line used as the baseline.
13: Spline user-drawn line used as the baseline.
----
pf.curPeak Read/write, numeric. The current peak. Because there are
pf.nPeaks peaks, you must use this property to specify a peak to access
its parameters. Its value must be between 0 and pf.nPeaks. Value 0
corresponds to the baseline. Because this value can be altered internally,
you must carefully monitor its value so that you can operate on the
correct peak. This property affects the pf.pn, pf.vn, pf.en, pf.ln,
pf.un, and pf.nn properties.
----
pf.fType Read only, numeric. The function type of all peaks in the
dataset:
0: General built-in function.
1: User-defined function of expression form.
2: User-defined function of Y-script form.
3: External DLL function.
7: User-defined function of convolution form.
----
pf.func$ Read/write, string. The fitting function for all peaks. This
property assumes that all peaks have the same fitting function. For



Programming the PFM with LabTalk Basic PFM Scripts: Getting Started 99



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,



100 Getting Results Programming the PFM with LabTalk



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.
Basic Peak Fitting - Methods
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.
Fitting Results - 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.
----



Programming the PFM with LabTalk Getting Results 101



pf.arean Read only, numeric. The fit area of the nth peak. This is the
area calculated according to the function definition, not the fitting
dataset.
----
pf.centern Read only, numeric. The center of the nth peak. In
general, it is the first parameter of a peak which is given by the property
pf.p1.
----
pf.chiSqr Read only, numeric. The chi-square value of the fit.
----
pf.COD Read only, numeric. The coefficient of determination of the
fit.
----
pf.confidence Read/write, numeric. Confidence value. Given a
confidence value, you can calculate confidence limits for parameters and
confidence/prediction bands for the fit curve. This property alters this
value from the default value 0.95 to any value between 0 and 1. The new
value remains inside the PFM unchanged until further assignment.
----
pf.COR Read only, numeric. The correlation coefficient which is
computed at the end of iterations.
----
pf.DOF Read only, numeric. The degrees of freedom.
----
pf.en Read only, numeric. The standard error values of the nth
parameter of the current peak (given by pf.curPeak, see "Basic PFM
Scripts: Getting Started" on page 97).
----
pf.err Read only, numeric. The error code. When the error message
box is suppressed using the property pf.msgPrompt=0, use this
property to get the error code.
The PFM shares many error messages with Origin's nonlinear curve
fitter. Only messages unique to the PFM are listed here.
28051: Error! The peak number 'XXXX' is out of the valid range. The
valid number must be between 0 and pf.npeaks.
28052: Error! The dataset number 'XXXX' is out of the valid range.
The valid number must be between 0 and pf.ndata.
28053: Error! The parameter name 'XXXX' is too long. Use names
with less than 8 characters.
28054: Error! You need to first assign a fitting function to the peak
'XXXX'. The peak XXXX has not been assigned a fitting function. You
cannot do any computation on this peak.
28055: Error! The user-defined function is invalid. Redefine it with the



102 Getting Results Programming the PFM with LabTalk



correct format. For more information, see "Peak Fitting Wizard
Reference".
28056: Error! The user-defined function 'XXXX' has no parameters.
For more information, see "Peak Fitting Wizard Reference".
28057: Error! The user-defined function 'XXXX' has an insufficient
number of parameters. For more information, see "Peak Fitting Wizard
Reference".
28059: Error! The dataset 'XXXX' does not exist.
28060: Error! The number of correct arguments is less than what is
needed. The operation cannot continue. Check the syntax of the method.
28061: Error! No dataset is specified for fitting operations. The
operation cannot continue. You need to supply a fitting dataset to the
PFM.
28062: Error! No fitting function has been set. Set appropriate
functions first before continuing the current operation.
28063: Warning! Initialization of the parameters of a fitting function
failed. You have to supply the initial parameter values yourself.
28064: Error! The dataset 'XXXX' has no valid elements. No
computation can be performed. This will occur if the data range is 0 or if
all the values in the dataset are missing.
28065: Error! There are not enough data points in the dataset(s) 'XXXX'
to be fitted. There may be too many missing cells or the fitting range is
too small. Check the dataset(s) to be fitted and the data range.
28066: Error! There are too many bad functional evaluations. The
parameter values of the fitting functions may be out of the valid range.
Check the parameter values.
----
pf.FWHMn Read only, numeric. The full width at half maximum of
the peak height of the nth peak based on the fit curve.
----
pf.heightn Read only, numeric. The maximum height of the nth peak.
----
pf.ln Read only, numeric. The lower confidence limit value of the nth
parameter of the current peak (given by pf.curPeak, see "Basic PFM
Scripts: Getting Started" on page 97) for a given confidence value
(pf.confidence).
Note: You must use pf.confidence and pf.paraConf( ) first.
----
pf.nIterGood Read only, numeric. The number of iterations that were
actually performed.
----
pf.nn Read only, numeric. The name of the nth parameter of the
current peak (given by pf.curPeak, see "Basic PFM Scripts: Getting
Started" on page 97). The name might be different than original



Programming the PFM with LabTalk Getting Results 103



definitions in the function, because the PFM appends numbers to
parameter names to denote peaks.
----
pf.nParaVary Read only, numeric. The number of varying
parameters.
----
pf.nPoints Read only, numeric. The total number of data points used
in the calculation.
----
pf.percentn Read only, numeric. The percentage area of a peak in the
entire data profile.
----
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.
For information on pf.curPeak and pf.nParan, see "Basic PFM
Scripts: Getting Started" on page 97.
----
pf.SSR Read only, numeric. The sum of squares.
----
pf.un Read only, numeric. The upper confidence limit value of the nth
parameter of the current peak (given by pf.curPeak, see "Basic PFM
Scripts: Getting Started" on page 97) for a given confidence value
(pf.confidence).
Note: You must use pf.confidence and pf.paraConf( ) first.
----
pf.widthn Read only, numeric. The width parameter of the nth peak as
defined in the peak function. It may not be the actual width of a peak,
depending on the function definition.
Fitting Results - Methods
pf.coVar(covar) Create the variance-covariance matrix covar.
----
pf.funcVal(n, x) Return the function value at X = x for the baseline
when n = 0, or the fit curve when n = -1, or the nth peak when n > 0.
----
pf.makeResidual( ) Create the residual dataset residual_y. The
residual is the difference between the original dataset and the fit curve.
----



104 Controlling the PFM Programming the PFM with LabTalk



pf.paraConf( ) Calculate confidence intervals for individual
parameters. View results using pf.un for the upper confidence limit of
parameter n, and pf.ln for the lower confidence limit. Use
pf.confidence to set the confidence value if you need values other than
0.95.
Controlling the PFM
Fine-tune the PFM using the following properties.
Advanced Control - Properties
pf.derivStep Read/write, numeric. The parameter change amount
(x) for calculating numerical derivatives. A smaller value gives higher
precision but may cause numerical round-off errors. The default value is
0.000001.
----
pf.mu Read/write, numeric. The value for diagonal magnification of
the curvature matrix. This value is important in the Levenberg-
Marquardt routine. Its default starting value is 0.001.
----
pf.muMin Read only, numeric. The smallest MU value ever reached.
----
pf.nIter Read/write, numeric. The default number of fitting iterations
if using the method pf.fit(-1).
For information on pf.fit(-1), see "Basic PFM Scripts: Getting Started"
on page 97.
----
pf.tolerance Read/write, numeric. The tolerance value to stop
iterations. The tolerance value is a stop criterion. The default value is
0.05. The smaller the tolerance, the more iterations are needed to satisfy
the criterion.



Programming the PFM with LabTalk Peaks With Different Functions 105



Peaks With Different Functions
Peaks in a dataset may sometimes be described by different functions.
For instance, the first peak might be Gaussian while the second is
Lorentzian. Using the following properties, you can fit data using a
different function for each peak.
Peaks with Different Functions - Properties
pf.pBeginn Read/write, numeric. The first row number of the fitting
data range of the nth peak. Defaults to the beginning of the Y column
data range.
----
pf.pBeginXn Read/write, numeric. The lower X bound of the fitting
data range of the nth peak. Defaults to the beginning of the Y column
data range.
----
pf.peakOnn Read/write, numeric. The nth peak to be active, which
means that it will be involved in the calculations. Only a valid peak can
be active. Defaults to 1: active.
----
pf.pEndn Read/write, numeric. The last row number of the fitting data
range of the nth peak. Defaults to the end of the Y column data range.
----
pf.pEndXn Read/write, numeric. The upper X bound of the fitting
data range of the nth peak. Defaults to the end of the Y column data
range.
----
pf.pFuncn$ Read/write, string. The fitting function for the nth peak.
This is different from the property pf.func$, which assigns a fitting
function to all peaks.
----
pf.pStepn Read/write, numeric. The step size of the fitting data range
of the nth peak. Defaults to 1.
----
pf.pTypen Read only, numeric. The function type of the nth peak.
When n = 0, it is the baseline type.
0: General built-in function.
1: User-defined function of expression form.
2: User-defined function of Y-script form.
3: External DLL function.
5: Built-in peak function used as the baseline.
11: Dataset used as the baseline.



106 Fitting a Section of a Dataset Programming the PFM with LabTalk



12: FreeForm user-drawn line used as the baseline.
13: Spline user-drawn line used as the baseline.
----
pf.pValidn Read only, numeric. Check if the nth peak is valid, i.e., it
has been assigned a valid fitting function. 0: not valid, 1: valid. A
successful application of the pf.func$ property will make all of the
peaks valid. The pf.pfuncn$ property will make the nth peak valid.
Defaults to 0: not valid.
For information on pf.func$, see "Basic PFM Scripts: Getting Started"
on page 97.
For information on pf.pFuncn$, see "Peaks With Different Functions"
on page 105.
Fitting a Section of a Dataset
The properties in this section help you fit a section of a dataset. A
section of a dataset is a range. The range is defined by its specified
beginning and end.
Fitting a Range - Properties
pf.dataBegin, pf.dataEnd Read/write, numeric. These two
properties establish a section of data for fitting (a fitting range). They are
the first and the last row numbers that denote the range. Only the data
points between them will be fitted. Their default values are 1 and the last
row number.
Note: If the property pf.y$ is used to assign the fitting dataset, these two
values will be set to their defaults (the full data range). Thus, you must
always use these two properties to establish the desired fitting range after
assigning new fitting data.
----
pf.dataBeginX, pf.dataEndX Read/write, numeric. These two
properties are similar to pf.dataBegin and pf.dataEnd, except that the
fitting range is denoted by X values rather than row numbers. For
example, pf.dataBeginX=20.55; pf.dataEndX=112.55; forces the
PFM to fit only data points that are between X = 20.55 and X = 112.55.
----
pf.dataStep Read/write, numeric. The data interval, which is defined
as an incremental step size when only a subset of data points is used.
This is a very useful feature when there are a large number of data points
and you need a rough guess of the fit. If its value is 1, every data point is



Programming the PFM with LabTalk Constraints 107



used. If its value is 2, every other data point is used, and so on. When
script is used for fitting, this value defaults to 1.
----
pf.useRowNum Read/write, numeric. If its value is 1, the row
number will be used to denote the fitting data range. Otherwise, the X
values will be used. The default value is 1.
Constraints
Sometimes there are relations between parameters. Constraints allow
such relations to be specified.
Constraints - Properties
pf.constr$ Read/write, string. The general linear constraints for
parameters. For example, pf.constr$ = A_1=2*A_2;w_1=0.5*w_2
sets A_1 to twice the value of A_2 and w_1 to half the value of w_2
during fitting. This property over-writes previous constraints. The new
constraints remain until you explicitly clear them. To clear the
constraints, use an empty string: pf.constr$=" ".
----
pf.lBoundn Read/write, numeric. The lower bound for the nth
parameter of the current peak (given by pf.curPeak, see "Basic PFM
Scripts: Getting Started" on page 97).
----
pf.lBoundOnn Read/write, numeric. Turn on/off the lower bound for
the nth parameter of the current peak (given by pf.curPeak, see "Basic
PFM Scripts: Getting Started" on page 97): 1 = on; 0 = off.
----
pf.nConstr Read only, numeric. The number of constraints. The
linear constraints are parsed and translated into a matrix-vector format
internally with pf.nConstr as the number of linear equations.
----
pf.nConstrEff Read only, numeric. The number of effective
constraints. If there are some parameters that are fixed, the PFM disables
them in the constraint equations by moving them from the left side of the
equations to the right side. This may reduce the total number of
equations. As a result, the final number of linear constraint equations
may be less than pf.nConstr and is pf.nConstrEff.
----



108 Constraints Programming the PFM with LabTalk



pf.uBoundn Read/write, numeric. The upper bound for the nth
parameter of the current peak (given by pf.curPeak, see "Basic PFM
Scripts: Getting Started" on page 97).
----
pf.uBoundOnn Read/write, numeric. Turn on/off the upper bound for
the nth parameter of the current peak (given by pf.curPeak, see "Basic
PFM Scripts: Getting Started" on page 97): 1 = on; 0 = off.
Constraints - Methods
pf.allEqual(cntrl, i) Review the pf.equal( ) and pf.equal2( )
methods. This method is similar to pf.equal( ) and pf.equal2( )
however it operates on the ith parameter on all peaks. For example,
pf.allEqual(1, 3) sets all peaks to have the same width.
----
pf.chkConstr( ) Check whether constraints are violated or not. This
method may help determine whether the constraints are self-consistent.
----
pf.equal(cntrl, i, j) Set up a parameter equivalence group. All the
parameters within this group will have the same value during fitting. Use
this method to add or remove a parameter of a peak from an equivalence
group.
cntrl=0: Removes the jth parameter of the ith peak from the jth
equivalence group.
cntrl=1: Puts the jth parameter of the ith peak into the jth equivalence
group.
cntrl=2: Checks whether the jth parameter of the ith peak is within the
jth equivalence group.
For example you could use this method to force peak 1, 2, and 5 to have
the same width (the peak type is not important). Because the width is the
third parameter of a peak function, pf.equal(1,1,3), pf.equal(1,2,3),
and pf.equal(1,5,3) will put the widths of the three peaks into an
equivalence group, so that the peaks will have the same width during
fitting.
Note that this method assumes that there is only one equivalence group
for a type of parameter (one for width, one for height, etc.).
----
pf.equal2(cntrl, i, j, k) Similar to the pf.equal( ) method. However,
this method operates on the kth parameter of the ith peak and the jth
peak. This method is useful when there are two or more equivalence
groups. For example, you can use pf.equal2(1, 1, 3, 3) and
pf.equal2(1, 2, 4, 3) to setup relations that the widths of peak 2 and
peak 4 are equal, and the widths of peak 1 and peak 3 are equal.
----



Programming the PFM with LabTalk Auxiliary Methods and Properties 109



pf.paraRange( ) Set the parameters to a region that satisfies any
constraints that exist.
----
pf.setConstr( ) Open the Set General Linear Constraints dialog box to
set general linear constraints for parameters. For example, use constraint
A_1=2*A_2 to set A_1 to twice the value of A_2 during fitting.
Auxiliary Methods and Properties
The following properties and methods can help you build custom
systems. They include properties and methods for the user-interface,
parameter initialization, and other useful tasks.
Customization - Properties
pf.heightEstn Read/write, numeric. The estimated top position of
peak n. This is the distance from peak top to the absolute zero. Given
estimations of the peak height and center, the pf.peakGuess( ) method
can perform parameter initialization.
----
pf.msgPrompt Read/write, numeric. Turn on/off the error message
boxes. The default is 1: error message boxes on. When developing your
own application, you probably don't want the error message box to
display every time there is a problem. Instead, you can use the pf.err
property to examine what happened.
For information on pf.err, see "Getting Results" on page 100.
----
pf.nFPoints Read/write, numeric. The number of points used in
generating the function plots FitFunc_fit and FitFunc_fns.
Customization - Methods
pf.addBase(cntrl) This method subtracts the baseline from the fitting
dataset or adds it back if there is a baseline.
cntrl=0: Subtract the baseline from the fitting dataset.
cntrl=1: Add the baseline back.
----
pf.adjustBase(cntrl, xData, yData, value) Adjust the baseline
height. (xData, yData) is the baseline characteristic baseline.
cntrl=0: Return the average Y value of dataset yData.
cntrl=1: Adjust the dataset yData to have average height value, and



110 Auxiliary Methods and Properties Programming the PFM with LabTalk



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



Programming the PFM with LabTalk Auxiliary Methods and Properties 111



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.



112 Auxiliary Methods and Properties Programming the PFM with LabTalk



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



Programming the PFM with LabTalk Fitting Multiple Datasets Simultaneously 113



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.
Fitting Multiple Datasets Simultaneously
The PFM can be configured to fit multiple datasets simultaneously. This
feature allows you to analyze a group of inter-related datasets. Begin by
using the pf.nData property to tell the PFM the number of the datasets
to be fitted. You can then use other properties to assign the dataset
names and other parameters.
Properties
pf.curData Read/write, numeric. The current dataset to work with.
(When pf.nData is set to a value greater than 1.)
----
pf.dataBeginn, pf.dataEndn Read/write, numeric. These two
properties are similar to pf.dataBegin and pf.dataEnd (see "Fitting a
Section of a Dataset" on page 106). They establish a fitting range for the
nth dataset. If you use pf.dataBegin and pf.dataEnd, you set the
range for all datasets. If you want a different range for each dataset, you
should use pf.dataBeginn and pf.dataEndn.
----
pf.dataBeginXn, pf.dataEndXn Read/write, numeric. Similar to
pf.dataBeginX and pf.dataEndX (see "Fitting a Section of a Dataset"
on page 106). They establish a fit range for the nth dataset. The range is
denoted by X values rather than row numbers. If you use
pf.dataBeginX and pf.dataEndX, you set the range for all datasets.
----
pf.dataPointsn Read/write, numeric. The number of data points used
in the nth dataset.
----



114 Fitting Multiple Datasets Simultaneously Programming the PFM with LabTalk



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).



Peak Fitting Module Index 115



Index
2
2nd derivative 53
A
Action modes 33
Adjacent averaging 40
Asym2Sig function 87
Asymmetric double sigmoidal
function 87
Asymmetrical Gaussian function 90
B
Baseline
conditioning 44
initialization 40
modifying points 43
selecting fitting function 43
shifting 45
subtracting 45
BiGauss function 90
Bounds
constraining parameters 60
C
CCE function 89
Chesler-Cram equation 89
Chi-square 69, 77
Coefficient of determination 69, 77
Confidence 69
Confidence bands 63
Confidence interval
parameters 68
Confidence level 63
Constraints 59, 60
general linear 61
upper and lower bounds 60
Convolution of functions 50
Correlation coefficient 69, 77
Cubic function 93
D
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
Degrees of freedom 69, 77
Dependency
parameters 68
Derivative
displaying second derivative 53
DLL
external DLL fitting function 95
E
ECS function 89
Edgeworth-Cramer Series function
89
EMGauss function 84
Enlarging wizard graph 53
Error values
weighting the data 64
ExpDec1 function 94
ExpDec2 function 94
ExpGrow1 function 94
ExpGrow2 function 94
Exponentially modified Gaussian
function 84
F
FFT filter smoothing 40
Filtering data 39
Fit curve
display for each peak 57
fixing parameters 59
initializing parameters 56
peak area 70
peak excess 71
peak gravity center 71
peak maximum 71
peak skew 71
peak variance 71
sharing parameters 60
Fitting 61, 64
confidence level 63



116 Index Peak Fitting Module



number iterations 62
residuals 65
results 66, 69, 76
tolerance 62
weighting methods 63
Fitting function
Asym2Sig 87
baseline 43
BiGauss 90
CCE 89
convolutions 50
Cubic 93
defining 48
ECS 89
EMGauss 84
ExpDec1 94
ExpDec2 94
ExpGrow1 94
ExpGrow2 94
external DLL 95
Gauss2 84
Gaussian 84
GCAS 88
Hyperbl 94
InvsPoly 90
Line 93
logNormal 88
Lorentz 85
parabola 93
Pearson7 87
Poly4 93
Poly5 93
Power2 91
PSVoigt1 86
PSVoigt2 86
Pulse 91
Sine 92
SineDamp 92
SineSqr 92
Voigt 85
Weibull3 87
Full view mode 33
G
Gauss2 function 84
Gaussian function 84
GCAS function 88
General linear constraints 61
Gram-Charlier A-Series function 88
H
Hidden peaks 53, 65
Hyperbl function 94
I
Individual fit curves 57
Initialization files 34
Installing
PFM 1
Instrumental weighting 64
Inverse polynomial function 90
InvsPoly function 90
Iterations 62
L
LabTalk
programming the PFM 97
Levenberg-Marquardt iterations 62
Line data plot
peak data 37
Line function 93
Linear constraints 61
LogNormal function 88
Lorentz function 85
Lower bounds
constraining parameters 60
P
Parabola function 93
Parameters
confidence interval 68
constraints 59, 60
general linear 61
upper and lower bounds 60
dependency 68
fixing 59
initialization 56
reporting fitting results 66, 76
sharing 60
standard error 68
Passive action mode 33
Peak area
fit curve 70
Peak data
adding and deleting peaks 52, 54
display as line or scatter 37
displaying second derivative 53
enlarging 53
finding hidden peaks 53, 65
finding peaks 51
precondition 37
selecting 35
range 35



Peak Fitting Module Index 117



selecting function 46, 56
smoothing 39
subtract offset 38
Peak excess
fit curve 71
Peak Fitting wizard
action mode 33
adding and deleting peaks 52, 54
baseline conditioning 44
baseline initialization 40
display individual fit curves 57
displaying second derivative 53
enlarging wizard graph 53
finding hidden peaks 53, 65
finding peaks 51
fitting 61, 64
hiding wizard map 34
initializing 34
initializing parameters 56
navigating 3
overview 31
peak functions 46, 56
precondition data 37
residuals 65
results 66, 69, 76
scaling baseline 45
script file 34
selecting data 35
setting constraints 59, 60
shortcut menu 33
subtracting baseline 45
view mode 33
wizard map 4
Peak gravity center
fit curve 71
Peak maximum
fit curve 71
Peak skew
fit curve 71
Peak variance
fit curve 71
Pearson7 function 87
PFM See also Peak Fitting wizard
installing 1
programming with LabTalk 97
starting 3
uninstalling 2
Poly4 function 93
Poly5 function 93
Power2 function 91
Precondition data 37
Prediction bands 63
Programming the PFM 97
Pseudo-Voigt function 86
PSVoigt1 function 86
PSVoigt2 function 86
Pulse function 91
R
Rectangular hyperbola function 94
Reduced chi-square 69, 77
Residuals 65
S
Savitsky-Golay smoothing 40
Scatter data plot
peak data 37
Script
programming the PFM 97
Script file
Peak Fitting wizard 34
Second derivative 53
Shirley baseline subtraction 39
Shortcut menu
Peak Fitting wizard 33
Sine function 92
SineDamp function 92
SineSqr function 92
Skew
fit curve 71
Smoothing data 39
Spline
baseline line connection 44
Standard error
parameters 68
Statistical weighting 64
Statistics
from fit 66, 69, 76
Subtract offset 38
Sum of squares 68, 77
T
Tolerance 62, 69
Tougaard baseline subtraction 39
U
Uninstalling
PFM 2
Upper bounds
constraining parameters 60
V
Variance
fit curve 71



118 Index Peak Fitting Module



View modes 33
Voigt function 85
W
Weibull3 function 87
Weighting the data 63
Wizard map
hiding 34

Potrebbero piacerti anche