naginterfaces.library.tsa.uni_​arima_​forecast_​state

naginterfaces.library.tsa.uni_arima_forecast_state(st, mr, par, c, rms, nfv)[source]

uni_arima_forecast_state produces forecasts of a time series, given a time series model which has already been fitted to the time series using uni_arima_estim() or uni_arima_estim_easy(). The original observations are not required, since uni_arima_forecast_state uses as input either the original state set produced by uni_arima_estim() or uni_arima_estim_easy() or the state set updated by a series of new observations using uni_arima_update(). Standard errors of the forecasts are also provided.

For full information please refer to the NAG Library document for g13ah

https://www.nag.com/numeric/nl/nagdoc_27.1/flhtml/g13/g13ahf.html

Parameters
stfloat, array-like, shape

The state set derived from uni_arima_estim() or uni_arima_estim_easy() originally, or as modified using earlier calls of uni_arima_update().

mrint, array-like, shape

The orders vector of the ARIMA model, in the usual notation.

parfloat, array-like, shape

The estimates of the values of the parameters, the values of the parameters, the values of the parameters and the values of the parameters which specify the model and which were output originally by uni_arima_estim() or uni_arima_estim_easy().

cfloat

, the value of the model constant. This will have been output by uni_arima_estim() or uni_arima_estim_easy().

rmsfloat

, the residual variance associated with the model.

If uni_arima_estim_easy() was used to estimate the model, should be set to , where and were output by uni_arima_estim_easy().

If uni_arima_estim() was used to estimate the model, should be set to , where and were output by uni_arima_estim().

nfvint

, the required number of forecasts.

Returns
fvafloat, ndarray, shape

forecast values relating to the original undifferenced series.

fsdfloat, ndarray, shape

The standard errors associated with each of the forecast values in .

Raises
NagValueError
(errno )

The orders vector is invalid.

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and the minimum size .

Constraint: .

(errno )

On entry, .

Constraint: .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

The original time series is , for and parameters have been fitted to the model of this time series using uni_arima_estim() or uni_arima_estim_easy().

Forecasts of , for , are calculated in five stages, as follows:

  1. set for , where is the number of differenced values in the series;

  2. calculate the values of , for , and ;

  3. calculate the values of , for , where and for are the first values in the state set, corrected for the constant;

  4. add the constant term to give the differenced series , for ;

  5. the differencing operations are reversed to reconstitute , for .

The standard errors of these forecasts are given by , for , where , is the residual variance of , and is the coefficient expressing the dependence of on .

To calculate , for , the following device is used.

A copy of the state set is initialized to zero throughout and the calculations outlined above for the construction of forecasts are carried out with the settings , and , for .

The resulting quantities corresponding to the sequence are precisely , .

The supplied time series model is used throughout these calculations, with the exception that the constant term is taken to be zero.