g13aaf carries out non-seasonal and seasonal differencing on a time series. Information which allows the original series to be reconstituted from the differenced series is also produced. This information is required in time series forecasting.
The routine may be called by the names g13aaf or nagf_tsa_uni_diff.
Let be the th value of a time series , for after non-seasonal differencing of order and seasonal differencing of order (with period or seasonality ). In general,
Non-seasonal differencing up to the required order is obtained using
Seasonal differencing up to the required order is then obtained using
Mathematically, the sequence in which the differencing operations are performed does not affect the final resulting series of values.
1: – Real (Kind=nag_wp) arrayInput
On entry: the undifferenced time series,
, for .
2: – IntegerInput
On entry: , the number of values in the undifferenced time series.
3: – IntegerInput
On entry: , the order of non-seasonal differencing.
4: – IntegerInput
On entry: , the order of seasonal differencing.
5: – IntegerInput
On entry: , the seasonality.
if , ;
if , .
6: – Real (Kind=nag_wp) arrayOutput
On exit: the differenced values in elements to , and reconstitution data in the remainder of the array.
7: – IntegerOutput
On exit: the number of differenced values in the array xd.
8: – 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, .
Constraint: if , .
On entry, .
On entry, .
On entry, , , and .
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.
The computations are believed to be stable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g13aaf is not threaded in any implementation.
The time taken by g13aaf is approximately proportional to .
This example reads in a set of data consisting of observations from a time series. Non-seasonal differencing of order and seasonal differencing of order (with seasonality of ) are applied to the input data, giving an output array holding differenced values and values which can be used to reconstitute the output array.