TS_COEF

The TS_COEF function computes the coefficients f 1 , f 2 , ... , f P used in a P th order autoregressive time-series forecasting model. The result is a P -element vector whose type is identical to X .

This routine is written in the IDL language. Its source code can be found in the file ts_coef.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = TS_COEF( X, P )

Arguments

X

An n -element single- or double-precision floating-point vector containing time-series samples.

P

An integer or long integer scalar that specifies the number of coefficients to be computed.

Keywords

MSE

Use this keyword to specify a named variable that will contain the mean square error of the P th order autoregressive model.

Example

Define an n -element vector of time-series samples.

X = [6.63, 6.59, 6.46, 6.49, 6.45, 6.41, 6.38, 6.26, 6.09, 5.99, $

     5.92, 5.93, 5.83, 5.82, 5.95, 5.91, 5.81, 5.64, 5.51, 5.31, $

     5.36, 5.17, 5.07, 4.97, 5.00, 5.01, 4.85, 4.79, 4.73, 4.76]

result = TS_COEF(X, 5) ; Compute the coefficients of a 5th order autoregressive model.

PRINT, result

IDL prints:

1.30168 -0.111783 -0.224527 0.267629 -0.233363

See Also

TS_FCAST