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 usinguni_arima_estim()
oruni_arima_estim_easy()
. The original observations are not required, sinceuni_arima_forecast_state
uses as input either the original state set produced byuni_arima_estim()
oruni_arima_estim_easy()
or the state set updated by a series of new observations usinguni_arima_update()
. Standard errors of the forecasts are also provided.For full information please refer to the NAG Library document for g13ah
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g13/g13ahf.html
- Parameters
- stfloat, array-like, shape
The state set derived from
uni_arima_estim()
oruni_arima_estim_easy()
originally, or as modified using earlier calls ofuni_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()
oruni_arima_estim_easy()
.- cfloat
, the value of the model constant. This will have been output by
uni_arima_estim()
oruni_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 byuni_arima_estim_easy()
.If
uni_arima_estim()
was used to estimate the model, should be set to , where and were output byuni_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()
oruni_arima_estim_easy()
.Forecasts of , for , are calculated in five stages, as follows:
set for , where is the number of differenced values in the series;
calculate the values of , for , and ;
calculate the values of , for , where and for are the first values in the state set, corrected for the constant;
add the constant term to give the differenced series , for ;
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.