KaleidaGraph

 

¤ýBrochure

 

¤ýQuick Tour

 

¤ýÁ¦Ç° »ç¾ç

 

¤ýÀÀ¿ë ¿¹Á¦

 

¤ý¼ö»ó/»ç¿ëÀÚ

 

¤ýµ¥¸ð ´Ù¿î

 

¤ý¾÷±×·¹À̵å

VersaTerm & Pro

VersaTilities

 

ÁÖ¹®

°¡°Ý

 

KaleidaGraph µ¥¸ð

ÀÚ·á ¿äû

´Ù¿î·Îµå

 

±â¼ú Áö¿ø

KaleidaGraph

KaleidaGraph Tips

VersaTerm

 

 

ȸ»ç ¼Ò°³

´º½º

º¸µµ ÀÚ·á

 

Curve Fitting


Basic Information

We can fax you information if you want to know how any of the curve fits in KaleidaGraph are calculated. E-mail technical support with your fax number and the curve fit(s) of interest.

The Linear, Polynomial, Exponential, Logarithmic, and Power curve fits in KaleidaGraph are calculated using the Least Squared Error method. Least Squares computes a set of coefficients to the specified function (in this case y = mx +b), that minimize the square of the difference between the original data and the predicting function. In other words, it minimizes the square of the error between the original data and the values predicted by the equation.

If you only want to display the curve fit:

  • Select a Line or Double-Y plot.
  • Change the variable's Line Style to None and choose None from the Show Markers pop-up menu in Plot Style (Plot menu).

If you want to display all of the data points, but only fit a certain section of the curve:

  • Copy the data you want to fit and paste it into a new column. Then create a Line plot, using both Y columns of data. Hide the new variable by choosing None from the Show Markers pop-up menu and a Line Style of None in Plot Style (Plot menu). Apply the curve fit to this variable. The curve fit will be displayed, but the second set of points won't be displayed.
  • An alternate method is to mask the unwanted cells in the original column. Create the plot and apply the curve fit to the remaining data. Go back to the data window and unmask the cells. Go back to the plot, choose Plot Style, and click OK. The plot will be redrawn to include the unmasked cells, but the curve fit will not be updated.

The R value (linear correlation coefficient) is always reported as a positive value. This is because KaleidaGraph first calculates R^2, and then takes the square root to arrive at the value for R.

Setting default font and font size for the curve fit equation table in v3.08 or later of KaleidaGraph:

    1. Choose the text tool from the tool palette and double-click on the table.
    2. Choose the proper font and size.
    3. Select Set Defaults from the File menu. Place a check in the box next to Equation Labels and remove the check next to Standard Labels.
    4. Click OK. You will not see the changes take effect until the next curve fit is applied.
    5. When you quit KaleidaGraph, save changes to the Style so that these changes will be remembered the next time you launch KaleidaGraph.

Using the Undo Macro command undoes any curve fits that were applied. This information is not recoverable and the Redo command will not bring it back. This is a design decision that was made back in v1.1 of KaleidaGraph. Otherwise, there is a high probability of a System crash.

Internally, the coefficients are stored in double precision format. The number of decimals displayed is determined by what is selected in the Equation Label Format dialog (Format menu). If you change the number of decimals, the curve fit is recalculated and the number of decimals in the coefficients will reflect the change.

It is possible to apply a Linear curve fit and a General curve fit (using y=mx+b) to the same data and get slightly different results. This is because these fits use different methods to arrive at their results.

It is valid to specify partial derivatives using Library definitions.

Errors can only be displayed by using the General curve fit. If you want errors for any of the other fits, program that particular function into the General curve fit.

  General Curve Fit

The errors that are displayed for the parameters are the standard error of the parameters. It can be read as the parameter value +/- the error.

The Chi Square value in KaleidaGraph is the total sum of the squared errors.

KaleidaGraph's General curve fit is based on the Levenberg-Marquardt algorithm. Our reference for this curve fit comes from Numerical Recipes in C , William H. Press, Brian P. Flannery, Saul A. Teukolsky, William T. Vetterling, Cambridge University Press. The section of this book which shows the formulas used in calculating the parameters and errors for the General curve fit is available in a .pdf format .

If you would like a way to add new curve fits to your previously saved plots, you need v3.0.4 or later. The master list of fits were added to the Trash list in the Edit General dialog.

To add curve fits from a saved plot to the master curve fit list:

  • Open the saved plot.
  • Choose the Edit General command from the General sub-menu.
  • Select the fit on the left side, select Clipboard on the right side, click on the Copy button, and click OK to exit the dialog.
  • Create a new plot from scratch.
  • Choose the Edit General command from the General sub-menu.
  • Click on the Add button to add a new fit to the list.
  • Select the new fit, select the Clipboard option, click on the Replace button, and click OK to leave the dialog.
  • Now you can use this fit for any new plots. Remember to save changes to the Macros file when quitting to make this permanent.

Initial guesses for the Gaussian curve fit:

  • m1 - the Y value that the tails of the curve approach for large values of |X|.
  • m2 - the maximum Y value of the curve.
  • m3 - the mean of the data.
  • m4 - the bell-width.

One way to fit two different equations is to combine them in a single curve fit definition using the if-else operator. If you had two functions such that:

      y = F1(x) for x < x1

      y = F2(x) for x >= x1,

      you could enter the following type of definition in the Define dialog:

      (x < x1 ? F1(x) : 0) + (x >= x1 ? F2(x) : 0)

To force a linear fit to go through a particular Y value at X = 0 you have to use the general fit. For example if you wanted to have Y=4 at X=0 you would use the equation:

      4 + b * x;

      in the general fit dialog. Similarly for Y=0 @ X=0 (the origin) you would use

      0 + b * x;

Stretched exponential curve fits:

  • Equations of the form: y = 1 - exp[ -(t / tau)^b]
  • This can cause a problem because KaleidaGraph could be trying to take a root of a negative value.
  • To solve the problem, rewrite the equation as: y = 1 - 1 / [exp((t / tau)^b)]

It is possible to include column numbers as part of the curve fit definition. In order to do this, you need to use the table command. For example, suppose you plotted c0 as X and c1 as Y and wished to use the values in c2 in the function: m1*m0^c2. Just using this equation would not work because the fit would not look at each of the values in c2. You need to replace c2 with table(m0, c0, c2). To use the table command, the X column must be sorted and there cannot be any duplicate values. The resulting definition would be: m1*m0^(table(m0,c0,c2)).

For the weights to be used as part of the General curve fit, you should enter the actual error value for each point. So if you have a value of 10 and it has an error of 1.5, enter 1.5 into the column as the weight.

Constants may be defined in the macro library and then used in a curve fit definition. For example, K=25 can be defined in the library. A curve fit definition of K+m1*m0 would be a valid definition.

The error values do not reside in the same memory registers of the Macro Calc. after each curve fit. It actually depends on the number of parameters in the fit. The error for m1 is always stored in m30. To find the error for m2, add the total number of parameters to 30 and look in that register. After that you add the number of parameters and subtract 1 more than the last time. Here is a list of where they are stored for a 9 parameter fit:

      m1 error - m30

      m2 error - m39 (30 + 9)

      m3 error - m47 (39 + 9 - 1)

      m4 error - m54 (47 + 9 - 2)

      m5 error - m60 (54 + 9 - 3)

      m6 error - m65

      m7 error - m69

      m8 error - m72

      m9 error - m74

  Smoothing Fits

It is not possible to extrapolate the various Smoothing fits to the axis limits because these fits do not result in an equation. This is because these fits cannot be represented by a single formula.

The difference between the Cubic Spline and the Smooth curve fits:

  • The Cubic Spline takes a 4-point moving window and calculates a cubic polynomial to those 4 points. The Smooth fit is an Interpolate curve fit with a weight applied. The weight is applied to 20% of the data (-10% to +10% of the data around the current point).

  Problems

No matter what type of curve fit you select (Power, Polynomial, etc.), KaleidaGraph draws a straight line on the graph:

  • Check the Curve Fit Options dialog (Format menu). The Curve Fit Points field could be set to 2. This would cause KaleidaGraph to calculate two points for the fit and draw a line between them. This field is normally set to 100.

[Tech Notes TOC][Previous page][Next page]

Untitled Document
Ȩ | VersaTerm | KaleidaGraph | ±â¼úÁö¿ø | µ¥¸ð ´Ù¿î·Îµå | ÁÖ¹®

ÇÊ»çÀ̾ð½º(ÁÖ) °æ±âµµ °í¾ç½Ã Àϻ굿±¸ ¹é¼®µ¿ 1141-2 À¯´ÏÅ×Å©ºô 825È£
Tel 031-905-7754 Fax 031-905-7724 E-mail:
Copyright ¨Ï 2000~2008 Phil Science, Inc. All rights reserved.