DADiSP Worksheet Functions > Function Categories > Statistics and Calculus > TREND

 

TREND

Purpose:

Fits a line to a series.

Syntax:

TREND(series)

series

-

A series.

Returns:

A series.

Example:

W1: integ(gnorm(1000,1))

W2: trend(W1);overp(W1, lred)

 

W2 contains the least squares best linear fit of the data. The resulting line is plotted with the original data.

Example:

W3: xy(W1, deriv(W1))

W4: trend(W3);overp(W3, lred)

 

W4 contains the best linear fit to the XY data in W3.

Remarks:

(fit, coeff) = trend(s) returns both the resulting fit and the linear coefficients {a0, a1} of the equation

 

image\trend01.gif

 

See DETREND to remove a linear trend from a series.

See Also:

DETREND

INTERPOLATE

LFIT

LINFIT

PFIT

POLYFIT

POLYGRAPH