Fits a line to a series.
TREND(series)
series |
- |
A series. |
A series.
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.
W3: xy(W1, deriv(W1))
W4: trend(W3);overp(W3, lred)
W4 contains the best linear fit to the XY data in W3.
(fit, coeff) = trend(s) returns both the resulting fit and the linear coefficients {a0, a1} of the equation
See DETREND to remove a linear trend from a series.