Logo

scikits.statsmodels.tsa.ar_model.AR.predict

AR.predict(n=-1, start=0, method='dynamic', resid=False, confint=False)[source]

Returns in-sample prediction or forecasts.

Parameters :

n : int

Number of periods after start to forecast. If n==-1, returns in- sample forecast starting at start.

start : int

Zero-indexed observation number at which to start forecasting, ie., the first forecast is start. If start==-1, forecasting starts from the end of the sample. If the model is fit using ‘cmle’ or ‘yw’, start cannot be less than k_ar. If start < k_ar for ‘cmle’ and ‘yw’, then start is set equal to k_ar.

method : string {‘dynamic’, ‘static’}

If method is ‘dynamic’, then fitted values are used in place of observed ‘endog’ to make forecasts. If ‘static’, observed ‘endog’ are used.

resid : bool

Whether or not to return the residuals.

confint : bool, float

Whether to return confidence intervals. If confint == True, 95 % confidence intervals are returned. Else if confint is a float, then it is assumed to be the alpha value of the confidence interval. That is confint == .05 returns a 95% confidence interval, and .10 would return a 90% confidence interval.

Returns :

predicted values : array

residuals : array, optional

confidence intervals : array, optional

Notes

The linear Gaussian Kalman filter is used to return pre-sample fitted values. The exact initial Kalman Filter is used. See Durbin and Koopman in the references for more information.

Previous topic

sm.tsa.ar_model.AR.loglike

Next topic

sm.tsa.ar_model.AR.score

This Page