class="resources" Exponential Fit (Not in Base Package) - LabVIEW 7.1 Help - Support - National Instruments
Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Exponential Fit (Not in Base Package)

Finds the exponential curve values and the set of exponential coefficients amplitude and damping, which describe the exponential curve that best represents the input data set using the least-squares solution. Details  Examples

Standard Deviation is the standard deviation, sigma[i] for data point (x[i],y[i]). If they are equal or you do not know, leave this array empty. Internally, LabVIEW sets all to 1.0.
Y must have the same sign and must contain at least two points. That is, yi > 0 for i = 0, 1, … n – 1 or yi < 0 for i = 0, 1, …n – 1, n 2, where Y represents the input sequence Y and n is the number of data points. If the signs are inconsistent or there are less than two sample points, the VI sets Best Exponential Fit to an empty array, sets amplitude, damping, and mse to NaN, and returns an error via the Exponential Fit Coefficients VI.
X must contain at least two points. n is greater than or equal to 2, where n is the number of data points.
Best Exponential Fit is the calculated values of the best exponential fit.
amplitude is the amplitude of Best Exponential Fit.
damping is the damping constant of Best Exponential Fit.
mse is the mean squared error.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Exponential Fit Details

The following equation gives the general form of the exponential fit.

where F is the output sequence Best Exponential Fit, X is the input sequence X, a is the amplitude, and is the damping constant.

The exponential fit assumes a model of the data of the following form.

where x is the independent variable, y is the dependent variable, a is amplitude, and is damping.

The fitting problem is to identify and a when given x and y.

The following actions and conditions summarize how to solve for and a.

  1. Take the natural log (ln) of both sides of . ln(y) = ln(a) + x.
  2. If and , then
    .
  3. is the equation of a line where x is the independent variable and is the dependent variable.
  4. Fit the line to the equation in step 3 using linear regression to find the values of and .
  5. Solve for a given . Recall that , or .

The VI calculates mse using the following equation.

where f is the output sequence Best Exponential Fit, y is the input sequence Y, and n is the number of data points.

Note  This VI performs an exponential fit even when the elements of Y are negative. It performs the fit under the assumption that the amplitude coefficient is also negative and returns a negative amplitude. Y cannot contain both positive and negative elements.

Examples

Refer to the following VIs for examples of using the Exponential Fit VI:

  • Regression Solver VI: labview\examples\analysis\regressn.llb

     

  • Regressions Demo VI: labview\examples\analysis\regressn.llb

     

  • Financial Forecasting VI: labview\examples\analysis\regressn.llb

     


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit