g13ajf applies a fully specified seasonal ARIMA model to an observed time series, generates the state set for forecasting and (optionally) derives a specified number of forecasts together with their standard deviations.
The routine may be called by the names g13ajf or nagf_tsa_uni_arima_forcecast.
3Description
The time series supplied to the routine is assumed to follow a seasonal autoregressive integrated moving average (ARIMA) model with known parameters.
The model is defined by the following relations.
(a) where is the result of applying non-seasonal differencing of order and seasonal differencing of seasonality and order to the series , and is a constant.
(b)
This equation describes the seasonal structure with seasonal period ; in the absence of seasonality it reduces to .
(c)
This equation describes the non-seasonal structure.
Given the series, the constant , and the model parameters , , , , the routine computes the following.
(a)The state set required for forecasting. This contains the minimum amount of information required for forecasting and comprises:
(i)the differenced series , for ;
(ii)the values required to reconstitute the original series from the differenced series ;
(iii)the intermediate series , for ;
(iv)the residual series , for , where .
(b)A set of forecasts of and their estimated standard errors, , for ( may be zero).
The forecasts and estimated standard errors are generated from the state set, and are identical to those that would be produced from the same state set by g13ahf.
Use of g13ajf should be confined to situations in which the state set for forecasting is unknown. Forecasting from the series requires recalculation of the state set and this is relatively expensive.
4References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
5Arguments
1: – Integer arrayInput
On entry: the orders vector of the ARIMA model, in the usual notation.
Constraints:
;
;
;
if , ;
if , ;
;
.
2: – Real (Kind=nag_wp) arrayInput
On entry: the values of the parameters, the values of the parameters, the values of the parameters, and the values of the parameters, in that order.
3: – IntegerInput
On entry: the exact number of , , and parameters.
Constraint:
.
4: – Real (Kind=nag_wp)Input
On entry: , the expected value of the differenced series (i.e., is the constant correction). Where there is no constant term, c must be set to .
5: – IntegerInput
On entry: must be set to if c was not estimated, and if c was estimated. This is irrespective of whether or not . The only effect is that the residual degrees of freedom are one greater when . Assuming the supplied time series to be the same as that to which the model was originally fitted, this ensures an unbiased estimate of the residual mean-square.
Constraint:
or .
6: – Real (Kind=nag_wp) arrayInput
On entry: the values of the original undifferenced time series.
7: – IntegerInput
On entry: , the length of the original undifferenced time series.
8: – Real (Kind=nag_wp)Output
On exit: the residual variance (mean square) associated with the model.
On entry: the dimension of the array st as declared in the (sub)program from which g13ajf is called.
Constraint:
. The expression on the right-hand side of the inequality is returned in nst.
11: – IntegerOutput
On exit: the number of values in the state set array st.
12: – IntegerInput
On entry: the required number of forecasts. If , no forecasts will be computed.
13: – Real (Kind=nag_wp) arrayOutput
On exit: if , fva contains the nfv forecast values relating to the original undifferenced time series.
14: – Real (Kind=nag_wp) arrayOutput
On exit: if , fsd contains the estimated standard errors of the nfv forecast values.
15: – IntegerInput
On entry: the dimension of the arrays fva and fsd as declared in the (sub)program from which g13ajf is called.
Constraint:
.
16: – Integer arrayOutput
On exit: contains validity indicators, one for each of the four possible parameter types in the model (autoregressive, moving average, seasonal autoregressive, seasonal moving average), in that order.
Each indicator has the interpretation:
On entry the set of parameter values of this type does not satisfy the stationarity or invertibility test conditions.
No parameter of this type is in the model.
Valid parameter values of this type have been supplied.
17: – Real (Kind=nag_wp) arrayWorkspace
18: – IntegerInput
On entry: the dimension of the array w as declared in the (sub)program from which g13ajf is called.
Constraint:
, where and .
19: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
The model is over-parameterised. The number of parameters in the model is greater than the number of terms in the differenced series, i.e., .
On entry, and the minimum size .
Constraint: , where and .
On entry, and the minimum size (the minimum size required is returned in nst).
Constraint: .
Unable to calculate the latest estimates of the backforecasts.
Satisfactory parameter estimates could not be obtained for all parameter types in the model. Inspect array isf for futher information on the parameter type(s) in error.
On entry, and .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
The computations are believed to be stable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13ajf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13ajf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
The time taken by g13ajf is approximately proportional to and the square of the number of backforecasts derived.
10Example
The data is that used in the example program for g13aff. Five forecast values and their standard errors, together with the state set, are computed and printed.