DADiSP Worksheet Functions > Function Categories > Curve Fitting > POWFIT

 

POWFIT

Purpose:

Fits y(x) = A xb using linearization.

Syntax:

POWFIT(series)

(fit, coef) = POWFIT(series)

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

series

-

Input series or array.

Returns:

A series.

 

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

 

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

Example:

W1: 10 * (1..100)^0.5

W2: powfit(w1);overp(w1, lred)

 

overplots the original data with the calculated power fit.

Example:

(fit, coef) = powfit(w1)

 

fit is the same series as in W2

 

coef == {10.0, 0.5}.

Remarks:

POWFIT fits a power curve of the form:

 

image\powf01.gif

 

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

 

image\powf02.gif

 

If x or y are not positive, the result will be complex.

 

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

 

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

See Also:

EXPFIT

GAUSSFIT

LINFIT

POLYFIT

TREND