Curve Fit

The Curve Fit dialog is used to fit a function to all or part of your data. You can enter or select an equation with up to six adjustable parameters. Curve Fit is available either by clicking the Curve Fit button A curve fit button image on the toolbar or by choosing Curve Fit from the Analyze menu.

A tutorial about curve fitting is available. To access it, choose Open from the File menu. Open the Experiments folder, and then the Tutorials folder.

Applying a Curve Fit

  1. You can fit a function either to the whole graph or just to a region of interest. To select a portion of the graph, click the graph and drag the mouse across the desired region.
  2. Click the Curve Fit button ** PLEASE DESCRIBE THIS IMAGE **or choose Curve Fit from the Analyze menu.
  3. Select Automatic or Manual, then select the General Equation you want to apply to your data. Click Try Fit if you are doing an automatic curve fit.
  4. Click OK to display the fit on your graph. Black brackets mark the beginning and end of the range. You can click and drag the brackets to adjust the fit. The Curve Fit box containing the equation and fit coefficients of the function will also be displayed.
  5. To remove the curve fit, click the X in the upper-left corner of the box.

See below for additional details about the Curve Fit dialog and adjusting your curve fit after it is displayed on your graph.

The Curve Fit Dialog

Fit Type

Select which type of curve fit you would like to perform: Automatic or Manual.

Note: If Automatic Fit Type is disabled, then Allow Automatic Curve Fit is not checked in the Preferences dialog. To allow automatic fits, check the box in Preferences.


Create Calculated Column

Check Create Calculated Column to create a column in the data table that contains the y-values of the fitted function at each value for the x-axis. When you check Create Calculated Column, other options will be displayed. Check Plot Column to have the new column plotted on the graph. Check Show Curve Fit to have the Curve Fit box displayed on the graph.

Once a calculated column has been plotted on the graph, you can adjust the variables by adding a Parameter Control from the Insert menu.


Weight Column

Logger Pro optionally uses direct weighting when calculating curve fits. Use the Weight Column feature to affect the weighting of certain data points in an automatic curve fit. If no column is chosen, the fit is calculated with uniform weights. Note: The Weight Column feature was created for advanced users. Most users will find it unnecessary and can safely leave the Weight column field blank.

Use the Weight Column feature:

  1. Create a manual or calculated column that contains the weighting factors you want. Larger numbers in the column that is used for weighting will assign the related point a greater direct weight.
  2. Click the Curve Fit button ** PLEASE DESCRIBE THIS IMAGE **or choose Curve Fit from the Analyze menu.
  3. Choose the column that contains the weighting factors as the Weight Column.
  4. Click Try Fit to preview the affect of the values in the Weight Column on the curve fit.

General Equation

Select an equation to fit to the data, then click Try Fit if you are doing an automatic fit.

Time Offset

When Time Offset is checked, the "t" variable in the equation will change to "(t-t0)". An offset, t0, equal to the time of the left edge of the currently selected region, will be used. You can adjust the selection in the active graph in the Curve Fit dialog.

This option may be useful if you want to apply a curve fit to a section of data that does not coincide with the time that data collection started. For example, suppose you start data collection and then toss a ball above a Motion Detector at t=3.2 seconds. When data collection is complete, you can select the position data starting at t=3.2 seconds. If you check Time Offset and then perform a Quadratic fit, the linear coefficient can be correctly interpreted as the velocity at t=3.2 seconds and the additive term can correctly be interpreted as the position at t=3.2 seconds. If Time Offset is not checked, the linear coefficient and additive constant cannot be interpreted in that way.

Define Function...

You can define and add customized mathematical functions to the general equation list. Click Define Function and type in the function in the box. Up to six parameters can be used in the equation; each parameter can occur only once in the expression. For example, A*x/(Bx2 + A) is not allowed because the parameter, A, occurs twice. If you want to use an expression that contains repeated parameters, apply a manual curve fit or model instead of an automatic curve fit. Note: If you save the file with a function you have defined, the custom equation will appear in the list when you open the file again.

Delete Function

Delete added functions by selecting the function and clicking Delete Function. Built-in functions cannot be deleted.

Power

If an equation with a variable or power, such as A*x^n (Variable Power), is selected, the Power box will be displayed and available for editing.


Coefficients

The coefficients can be adjusted individually to improve the fit of the function to the data. Either type in a new value, or use the + and - buttons to step the value of the parameter up and down. Note: If you enter coefficient values directly, the curve fit type switches to Manual.

Depending on the coefficients initially chosen, a function may not fall within the graph window. In this case it may be difficult to adjust the coefficients to achieve a good fit. You may want to calculate the necessary values to force the function to pass through one data point (often the y-intercept) and begin with these values.

Click the Delta button ** PLEASE DESCRIBE THIS IMAGE ** to set a value by which to increase or decrease the coefficient value when clicking the + and - buttons to the right of the coefficients.



You can adjust the parameters of a Manual fit after it has been drawn on the graph. Click a parameter name in the Curve Fit box to select it. An arrow next to the parameter name will appear. Use the up and down cursor keys to increase or decrease the value. Use the left and right cursor keys to increase or decrease the step size by which the value is changed the value. You can also click the value and type in a new value. Double-clicking the box will open a dialog where you are able to change all of the parameter values at once.

Note: For general curve fit information, consult Numerical Recipes in C©, Second Edition (1992) Cambridge University Press. The book, in its entirety, is available online. Logger Pro does not use the routines in Numerical Recipes in C, but the concepts are identical. Another resource is Data Reduction and Error Analysis for the Physical Sciences by Bevington and Robinson, 2nd Edition, 1992, McGraw-Hill.

See Also: