This page will briefly illustrate how to upload your own data and fit them with a curve. The data used are those in Markwardt's tutorial, and the input xml is generated from an ascii file as demonstrated in the Perl tutorial. You may also download the data directly. The data are meant to represent counts from a detector, and the error is simply the Poisson statistical error.
This tutorial assumes some familiarity with the Curve Fitting Tool. There is a beginner tutorial available for first time users. If you are ready to try the upload tutorial and have not already done so, launch the Curve Fitting Tool.
Upload Data
The data for this tutorial should be uploaded to the tool from the user's computer. First download the Markwardt data to your system and click on "Launch Upload Tool" button to upload the XML file:
The data upload tool should open. Click the Browse button, choose the file markwardt.xml that contains the Markwardt sample data, and click Ok:
If your input data file is valid, you will get a success message indicating that the file markwardt.xml has successfully loaded. The View Data and Input Parameters frames should unfreeze and become available for use.
View Data
You may now view the data. Go to the View Data panel and select Plot Data. A graph of the data will appear in the plot window:
Input Parameters
From the graph above, the data look like they could be fit with a Gaussian plus a constant value, which is the fitting expression chosen by Markwardt as well. In the expression field, enter
P[0] + gauss1(X, P[1:3])
Markwardt uses starting values of P[0] = 950., P[1] = 2.5, P[2] = 1., and P[3] = 1000 in his tutorial . We will do the same. First, we note that in the Markwardt routine gauss1, P[1] is the mean of the Gaussian, P[2] is the sigma, and P[3] is the area under the Gaussian. Choose four fitting parameters in the drop menu and enter the above initial values. Your Input Parameters panel should look like the following:
Click on the Fit Curve button. The following Curve Fit window will appear with the results of the fit:
View Fit
To view the fit, go to the View Fit panel. Leave all the settings at their default values and click the View Fit button. The following plot will appear:
The thick curve shows the fit, which is quite good.
Challenge
Try different starting values for the fitting parameters. Do you get the same final values? What happens if all initial values are zero?