g13aa 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.
Syntax
C# |
---|
public static void g13aa( double[] x, int nx, int nd, int nds, int ns, double[] xd, out int nxd, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g13aa ( _ x As Double(), _ nx As Integer, _ nd As Integer, _ nds As Integer, _ ns As Integer, _ xd As Double(), _ <OutAttribute> ByRef nxd As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g13aa( array<double>^ x, int nx, int nd, int nds, int ns, array<double>^ xd, [OutAttribute] int% nxd, [OutAttribute] int% ifail ) |
F# |
---|
static member g13aa : x : float[] * nx : int * nd : int * nds : int * ns : int * xd : float[] * nxd : int byref * ifail : int byref -> unit |
Parameters
- x
- Type: array<System..::..Double>[]()[][]An array of size [nx]On entry: the undifferenced time series, , for .
- nx
- Type: System..::..Int32On entry: , the number of values in the undifferenced time series.Constraint: .
- nd
- Type: System..::..Int32On entry: , the order of non-seasonal differencing.Constraint: .
- nds
- Type: System..::..Int32On entry: , the order of seasonal differencing.Constraint: .
- ns
- Type: System..::..Int32On entry: , the seasonality.Constraints:
- if , ;
- if , .
- xd
- Type: array<System..::..Double>[]()[][]An array of size [nx]On exit: the differenced values in elements to , and reconstitution data in the remainder of the array.
- nxd
- Type: System..::..Int32%On exit: the number of differenced values in the array xd.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
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
for | |||
for | |||
for |
Seasonal differencing up to the required order is then obtained using
for | |||
for | |||
for |
Mathematically, the sequence in which the differencing operations are performed does not affect the final resulting series of values.
References
None.
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, , or , or , or when .
On entry, .
Accuracy
The computations are believed to be stable.
Parallelism and Performance
None.
Further Comments
The time taken by g13aa is approximately proportional to .
Example
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.
Example program (C#): g13aae.cs