EXPFIT

Purpose:

Fits y(x) = A ebx using linearization.

Syntax:

EXPFIT(series)

(fit, coef) = EXPFIT(series)

(fit, A, b) = EXPFIT(series)

series

-

Input series or array.

Returns:

A series.

 

(fit, coef) = EXPFIT(series) returns both the fit and the coefficients as a series.

 

(fit, A, b) = EXPFIT(series) returns both the fit as a series and the coefficients as separate coefficients.

Example:

W1: 10 * exp((1..100) * -0.5)

W2: expfit(w1);overplot(w1, lred)

 

overplots the original data with the calculated exponential fit.

Example:

(fit, coef) = expfit(w1)

 

fit is the same series as in W2

 

coef == {10.0, -0.5}

Remarks:

EXPFIT fits an exponential curve of the form:

 

image\expf01.gif

 

The fit is accomplished by fitting a line to the following equation:

 

image\expf02.gif

 

If y is not positive, the result will be complex.

 

The fitted exponential curve (fit, coef) = expfit(series) returns both the fit and the coefficients as a series where coef is in the form {A, b}.

 

The fitted exponential curve (fit, A, b) = expfit(series) returns the fit as a series and the coefficients as separate scalars.

See Also:

EXPMOVAVG

GAUSSFIT

LINFIT

POLYFIT

POWFIT

TREND