naginterfaces.library.tsa.multi_inputmod_forecast¶
- naginterfaces.library.tsa.multi_inputmod_forecast(mr, mt, para, kfc, nev, nfv, xxy, kzef, rmsxy, mrx, parx, isttf, io_manager=None)[source]¶
multi_inputmod_forecast
produces forecasts of a time series (the output series) which depends on one or more other (input) series via a previously estimated multi-input model for which the state set information is not available. The future values of the input series must be supplied. In contrast withmulti_inputmod_forecast_state()
the original past values of the input and output series are required. Standard errors of the forecasts are produced. If future values of some of the input series have been obtained as forecasts using ARIMA models for those series, this may be allowed for in the calculation of the standard errors.For full information please refer to the NAG Library document for g13bj
https://www.nag.com/numeric/nl/nagdoc_29.2/flhtml/g13/g13bjf.html
- Parameters
- mrint, array-like, shape
The orders vector of the ARIMA model for the output noise component.
, , and refer respectively to the number of autoregressive , moving average , seasonal autoregressive and seasonal moving average parameters.
, and refer respectively to the order of non-seasonal differencing, the order of seasonal differencing and the seasonal period.
- mtint, array-like, shape
The transfer function model orders , and of each of the input series. The data for input series is held in column . Row 1 holds the value , row 2 holds the value and row 3 holds the value .
For a simple input, .
Row 4 holds the value , where for a simple input, and or for a transfer function input.
The choice leads to estimation of the pre-period input effects as nuisance parameters, and suppresses this estimation.
This choice may affect the returned forecasts and the state set.
When , any nonzero contents of rows 1, 2 and 3 of column are ignored.
- parafloat, array-like, shape
Estimates of the multi-input model parameters. These are in order, firstly the ARIMA model parameters: values of parameters, values of parameters, values of parameters, values of parameters.
These are followed by the transfer function model parameter values , for the first of any input series and similarly for each subsequent input series.
The final component of is the value of the constant .
- kfcint
Must be set to if the constant was estimated when the model was fitted, and if it was held at a fixed value. This only affects the degrees of freedom used in calculating the estimated residual variance.
- nevint
The number of original (undifferenced) values in each of the input and output time series.
- nfvint
The number of forecast values of the output series required.
- xxyfloat, array-like, shape
The columns of must contain in the first places, the past values of each of the input and output series, in that order. In the next places, the columns relating to the input series (i.e., columns to ) contain the future values of the input series which are necessary for construction of the forecasts of the output series .
- kzefint
Must be set to if the relevant values of the forecasts () are to be held in the output series column () of (which is otherwise unchanged) on exit, and must not be set to if the values of the input component series and the values of the output noise component are to overwrite the contents of on exit.
- rmsxyfloat, array-like, shape
The first elements of must contain the estimated residual variance of the input series ARIMA models. In the case of those inputs for which no ARIMA model is available or its effects are to be excluded in the calculation of forecast standard errors, the corresponding entry of should be set to .
- mrxint, array-like, shape
The orders array for each of the input series ARIMA models. Thus, column contains values of , , , , , , for input series . In the case of those inputs for which no ARIMA model is available, the corresponding orders should be set to .
- parxfloat, array-like, shape
Values of the parameters (, , , and ) for each of the input series ARIMA models.
Thus column contains values of , values of , values of and values of , in that order.
Values in the columns relating to those input series for which no ARIMA model is available are ignored.
- isttfint
The dimension of the array .
- io_managerFileObjManager, optional
Manager for I/O in this routine.
- Returns
- parafloat, ndarray, shape
The parameter values may be updated using an additional iteration in the estimation process.
- xxyfloat, ndarray, shape
If then is unchanged except that the relevant values in the column relating to the output series (column ) contain the forecast values (), but if then the columns of contain the corresponding values of the input component series and the values of the output noise component , in that order.
- rmsxyfloat, ndarray, shape
contains the estimated residual variance of the output noise ARIMA model which is calculated from the supplied series. Otherwise is unchanged.
- mrxint, ndarray, shape
Unchanged, except for column which is used as workspace.
- fvafloat, ndarray, shape
The required forecast values for the output series. (Note that these are also output in column of if .)
- fsdfloat, ndarray, shape
The standard errors for each of the forecast values.
- sttffloat, ndarray, shape
The values of the state set based on the first sets of (past) values of the input and output series.
- nsttfint
The number of values in the state set array .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, , and .
Constraint: .
- (errno )
On entry, .
Constraint: or .
- (errno )
The orders vector is invalid.
- (errno )
is inconsistent with and .
- (errno )
Insufficient degrees of freedom to solve the problem.
- (errno )
On entry, and the expected .
Constraint: , and must be consistent.
- (errno )
On entry, and .
Constraint: , or .
- (errno )
One or more sets of delta parameters do not satisfy the stationarity or invertibility conditions.
- (errno )
Unable to calculate the latest parameter estimates.
- (errno )
Failure in inversion of second derivative matrix.
- (errno )
One or more sets of ARIMA parameters do not satisfy the stationarity or invertibility conditions.
- (errno )
On entry, .
Constraint: .
- Notes
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
multi_inputmod_forecast
has two stages. The first stage is essentially the same as a call to the model estimation functionmulti_inputmod_estim()
, with zero iterations. In particular, all the parameters remain unchanged in the supplied input series transfer function models and output noise series ARIMA model. The internal nuisance parameters associated with the pre-observation period effects of the input series are estimated where requested, and so are any backforecasts of the output noise series. The output components and , and residuals are calculated exactly as in Notes for multi_inputmod_estim, and the state set for forecasting is constituted.The second stage is essentially the same as a call to the forecasting function
multi_inputmod_forecast_state()
. The same information is required, and the same information is returned.Use of
multi_inputmod_forecast
should be confined to situations in which the state set for forecasting is unknown. Forecasting from the original data is relatively expensive because it requires recalculation of the state set.multi_inputmod_forecast
returns the state set for use in producing further forecasts usingmulti_inputmod_forecast_state()
, or for updating the state set usingmulti_inputmod_update()
.
- References
Box, G E P and Jenkins, G M, 1976, Time Series Analysis: Forecasting and Control, (Revised Edition), Holden–Day