Curve Fitting with Excel Using the TREND FunctionLast reviewed: August 20, 1995Article ID: Q34315 |
The information in this article applies to:
SUMMARYThe following information describes how to perform polynomial curve fitting with the TREND function.
An Explanation of Curve FittingCurve fitting is useful for making projections beyond a data range (extrapolation) or for making estimates between acquired data points (interpolation). For example, suppose a scientist has collected data, such as voltage versus resulting current, as follows:
Voltage Resulting Current ---------------------------- 1 1.5 2 3.7 3 5.0 4 13 5 16 6 30 7 35 8 50This data is nonlinear; therefore, the corresponding graph is not a straight line (the actual formula used here was y=x^2-2*x+3 with the values adjusted at random to represent real laboratory data). An approximating formula for a curve that would best fit the known data points is necessary.
Using the TREND Function for Curve FittingThe following steps use the TREND function to fit a curve to the data points from the above sample data.
MORE INFORMATION
Using a Simpler Formula in Place of SINEA quicker approach, if absolute accuracy is not necessary, is to substitute a different formula in place of the SINE function that approximates the original function in a predefined interval on the x-axis. This formula is simpler and therefore faster for the computer to calculate. Assume you are interested in the interval from x=0 to x=1. An approximating polynomial for y=sin(x) of degree 0 might be y=1, of degree 1 might be y=x, and of degree 3 might be y=x+(x^3)/6. The degree of the polynomial refers to the highest power of x used. If you understand Taylor polynomials, you know why you skipped the polynomial of Degree 2, and how you arrived at the other polynomials. If you are not familiar with Taylor polynomials, do not worry about it because Microsoft Excel will handle the details. The following is an example:
DEGREE 0 1 3 x-value y=sin(x) | y=1 y=x y=x-(x^3)/6 ------------------------------------------------- 0.000 0.000 1.000 0.000 0.000 0.200 0.199 1.000 0.200 0.199 0.400 0.389 1.000 0.400 0.389 0.600 0.565 1.000 0.600 0.564 0.800 0.717 1.000 0.800 0.715 1.000 0.841 1.000 1.000 0.833The higher the degree of the approximating polynomial, the higher the accuracy. Higher degree polynomials require more calculations, so there is a point of diminishing returns. Also, high degree-approximating polynomials may produce inaccurate, highly fluctuating results (a good rule to follow is to use polynomials of degree no higher than 5).
Microsoft Excel version 5.0Microsoft Excel version 5.0 has the built-in capability to insert a polynomial curve into your existing x-y scatter chart. To insert this type of curve, follow these steps:
For information about another curve fitting technique, query on the following word in the Microsoft Knowledge Base:
newton |
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |