The routine may be called by the names g13bbf or nagf_tsa_multi_filter_transf.
From a given series a new series is calculated using a supplied (filtering) transfer function model according to the equation
As in the use of g13baf, large transient errors may arise in the early values of due to ignorance of for , and two possibilities are allowed.
(i)The equation (1) is applied from so all terms in on the right-hand side of (1) are known, the unknown set of values for being taken as zero.
(ii)The unknown values of for are estimated by backforecasting exactly as for g13baf.
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
1: – Real (Kind=nag_wp) arrayInput
On entry: the backforecasts starting with backforecast at time to backforecast at time followed by the time series starting at time , where . If there are no backforecasts either because the ARIMA model for the time series is not known or because it is known but has no moving average terms, then the time series starts at the beginning of y.
2: – IntegerInput
On entry: the total number of backforecasts and time series data points in array y.
3: – Integer arrayInput
On entry: the orders vector for the filtering transfer function model followed by the orders vector for the ARIMA model for the time series if the latter is known. The transfer function model orders appear in the standard form as given in the G13 Chapter Introduction. Note that if the ARIMA model for the time series is supplied then the routine will assume that the first values of the array y are backforecasts.
the filtering model is restricted in the following way:
the ARIMA model for the time series is restricted in the following ways:
, for ;
if , ;
if , ;
4: – IntegerInput
On entry: the number of values supplied in the array mr. It takes the value if no ARIMA model for the time series is supplied but otherwise it takes the value . Thus nmr acts as an indicator as to whether backforecasting can be carried out.
5: – Real (Kind=nag_wp) arrayInput
On entry: the parameters of the filtering transfer function model followed by the parameters of the ARIMA model for the time series. In the transfer function model the parameters are in the standard order of MA-like followed by AR-like operator parameters. In the ARIMA model the parameters are in the standard order of non-seasonal AR and MA followed by seasonal AR and MA.
6: – IntegerInput
On entry: the total number of parameters held in array par.
if , ;
if , .
7: – Real (Kind=nag_wp)Input
On entry: if the ARIMA model is known (i.e., ), cy must specify the constant term of the ARIMA model for the time series. If this model is not known (i.e., ) then cy is not used.
8: – Real (Kind=nag_wp) arrayOutput
9: – IntegerInput
These arguments are no longer accessed by g13bbf. Workspace is provided internally by dynamic allocation instead.
10: – Real (Kind=nag_wp) arrayOutput
On exit: the filtered output series. If the ARIMA model for the time series was known, and hence backforecasts were supplied in y, then b contains ‘filtered’ backforecasts followed by the filtered series. Otherwise, the filtered series begins at the start of b just as the original series began at the start of y. In either case, if the value of the series at time is held in , then the filtered value at time is held in .
11: – IntegerInput
On entry: the dimension of the array b as declared in the (sub)program from which g13bbf is called.
In addition to holding the returned filtered series, b is also used as an intermediate work array if the ARIMA model for the time series is known.
if , ;
if , .
12: – 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).
Errors or warnings detected by the routine:
On entry, , .
On entry, .
On entry, , and .
On entry, , and .
On entry, and the minimum size . Constraint: if then , otherwise .
On entry, .
Constraint: or .
On entry, .
Constraint: npar must be inconsistent with mr.
A supplied model has invalid parameters.
The supplied time series is too short.
The matrix used to solve for starting values for MA is singular.
An unexpected error has been triggered by this routine. Please
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.
Accuracy and stability are high except when the AR-like parameters are close to the invertibility boundary. All calculations are performed in basic precision except for one inner product type calculation which on machines of low precision is performed in additional precision.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13bbf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13bbf 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.
If an ARIMA model is supplied,
a local workspace array
allocated internally by g13bbf. The total size of
amounts to integer
is the expression defined in the description of the argument wa.
The time taken by g13bbf is roughly proportional to the product of the length of the series and number of parameters in the filtering model with appreciable increase if an ARIMA model is supplied for the time series.
This example reads a time series of length . It reads one univariate ARIMA model for the series and the filtering transfer function model. initial backforecasts are required and these are calculated by a call to
The backforecasts are inserted at the start of the series and g13bbf is called to perform the filtering.