NAG CL Interface
g13awc (uni_dickey_fuller_unit)
1
Purpose
g13awc returns the (augmented) Dickey–Fuller unit root test.
2
Specification
double |
g13awc (Nag_TS_URTestType type,
Integer p,
Integer n,
const double y[],
NagError *fail) |
|
The function may be called by the names: g13awc, nag_tsa_uni_dickey_fuller_unit or nag_tsa_dickey_fuller_unit.
3
Description
If the root of the characteristic equation for a time series is one then that series is said to have a unit root. Such series are nonstationary. g13awc returns one of three types of (augmented) Dickey–Fuller test statistic: , or , used to test for a unit root, a unit root with drift or a unit root with drift and a deterministic time trend, respectively.
To test whether a time series,
, for
, has a unit root, the regression model
is fitted and the test statistic
constructed as
where
is the difference operator, with
, and where
and
are the least squares estimate and associated standard error for
respectively.
To test for a unit root with drift the regression model
is fit and the test statistic
constructed as
To test for a unit root with drift and deterministic time trend the regression model
is fit and the test statistic
constructed as
The distributions of the three test statistics;
,
and
, are nonstandard. An associated probability can be obtained from
g01ewc.
4
References
Dickey A D (1976) Estimation and hypothesis testing in nonstationary time series PhD Thesis Iowa State University, Ames, Iowa
Dickey A D and Fuller W A (1979) Distribution of the estimators for autoregressive time series with a unit root J. Am. Stat. Assoc. 74 366 427–431
5
Arguments
-
1:
– Nag_TS_URTestType
Input
-
On entry: the type of unit test for which the probability is required.
- A unit root test will be performed and returned.
- A unit root test with drift will be performed and returned.
- A unit root test with drift and deterministic time trend will be performed and returned.
Constraint:
, or .
-
2:
– Integer
Input
-
On entry: , the degree of the autoregressive (AR) component of the Dickey–Fuller test statistic. When the test is usually referred to as the augmented Dickey–Fuller test.
Constraint:
.
-
3:
– Integer
Input
-
On entry: , the length of the time series.
Constraints:
- if , ;
- if , ;
- if , .
-
4:
– const double
Input
-
On entry: , the time series.
-
5:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry,
.
Constraint:
- if , ;
- if , ;
- if , .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_ORDERS_ARIMA
-
On entry, .
Constraint: .
- NW_SOLN_NOT_UNIQUE
-
On entry, the design matrix used in the estimation of is not of full rank, this is usually due to all elements of the series being virtually identical. The returned statistic is therefore not unique and likely to be meaningless.
- NW_TRUNCATED
-
, therefore depending on the sign of , a large positive or negative value has been returned.
7
Accuracy
Not applicable.
8
Parallelism and Performance
g13awc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g13awc 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 function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
10
Example
In this example a Dickey–Fuller unit root test is applied to a time series related to the rate of the earth's rotation about its polar axis.
10.1
Program Text
10.2
Program Data
10.3
Program Results