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)

W3: xy(W1, integ(W1))

W4: trend(W3);overp(W3)

 

trend1.png

W2 contains the least squares best linear fit of the data in W1. The result is plotted with the original data.

 

W4 contains the best linear fit to the XY data in W3. The result is plotted with the original data.

Remarks:

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

 

linear trend

 

See DETREND to remove a linear trend from a series.

See Also:

DETREND

INTERPOLATE

LFIT

LINFIT

PFIT

POLYFIT

POLYGRAPH