Syntax
C# |
---|
public static void g13dl( int k, int n, double[,] z, string[] tr, int[] id, double[,] delta, double[,] w, out int nd, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g13dl ( _ k As Integer, _ n As Integer, _ z As Double(,), _ tr As String(), _ id As Integer(), _ delta As Double(,), _ w As Double(,), _ <OutAttribute> ByRef nd As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g13dl( int k, int n, array<double,2>^ z, array<String^>^ tr, array<int>^ id, array<double,2>^ delta, array<double,2>^ w, [OutAttribute] int% nd, [OutAttribute] int% ifail ) |
F# |
---|
static member g13dl : k : int * n : int * z : float[,] * tr : string[] * id : int[] * delta : float[,] * w : float[,] * nd : int byref * ifail : int byref -> unit |
Parameters
- k
- Type: System..::..Int32On entry: , the dimension of the multivariate time series.Constraint: .
- n
- Type: System..::..Int32On entry: , the number of observations in the series, prior to differencing.Constraint: .
- z
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, n]Note: dim1 must satisfy the constraint:On entry: must contain, , the th component of , for and .Constraints:
- if , ;
- if , , for and .
- tr
- Type: array<System..::..String>[]()[][]An array of size [k]On entry: indicates whether the th time series is to be transformed, for .
- No transformation is used.
- A log transformation is used.
- A square root transformation is used.
Constraint: , or , for .
- id
- Type: array<System..::..Int32>[]()[][]An array of size [k]On entry: the order of differencing for each series, .Constraint: , for .
- delta
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, dim2]Note: dim1 must satisfy the constraint:Note: the second dimension of the array delta must be at least , where .On entry: if , then must be set equal to , for and .If , then delta is not referenced.
- w
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, dim2]Note: dim1 must satisfy the constraint:Note: the second dimension of the array w must be at least , where .On exit: contains the value of , for and .
- nd
- Type: System..::..Int32%On exit: the number of differenced values, , in the series, where .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
For certain time series it may first be necessary to difference the original data to obtain a stationary series before calculating autocorrelations, etc. This method also allows you to apply either a square root or a log transformation to the original time series to stabilize the variance if required.
If the order of differencing required for the th series is , then the differencing operator is defined by , where is the backward shift operator; that is, . Let denote the maximum of the orders of differencing, , over the series. The method computes values of the differenced/transformed series , for , as follows:
where are the transformed values of the original -dimensional time series .
The differencing parameters , for and , must be supplied by you. If the th series does not require differencing, then .
References
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Wei W W S (1990) Time Series Analysis: Univariate and Multivariate Methods Addison–Wesley
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(KMAX) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or ,
On entry, , for some , or , for some .
On entry, at least one of the first elements of tr is not equal to "N", "L" or "S".
- On entry, one or more of the elements of z is invalid, for the transformation requested; that is, you may be trying to log or square root a series, some of whose values are negative.
Accuracy
The computations are believed to be stable.
Parallelism and Performance
None.
Further Comments
The same differencing operator does not have to be applied to all the series. For example, suppose we have , and wish to apply the second-order differencing operator to the first series and the first-order differencing operator to the second series:
Then , , and
Example
A program to difference (non-seasonally) each of two time series of length . No transformation is to be applied to either of the series.
Example program (C#): g13dle.cs