PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_tsa_uni_dickey_fuller_unit (g13aw)
Purpose
nag_tsa_uni_dickey_fuller_unit (g13aw) returns the (augmented) Dickey–Fuller unit root test.
Syntax
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. nag_tsa_uni_dickey_fuller_unit (g13aw) 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 fit 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
nag_stat_prob_dickey_fuller_unit (g01ew).
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
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
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:
– int64int32nag_int scalar
-
, 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:
– double array
-
, the time series.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
y.
, the length of the time series.
Constraints:
- if , ;
- if , ;
- if , .
Output Parameters
- 1:
– double scalar
-
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
Constraint: , or .
-
-
Constraint: .
-
-
Constraint:
- if , ;
- if , ;
- if , .
-
-
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.
-
-
, therefore depending on the sign of , a large positive or negative value has been returned.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
None.
Further Comments
None.
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.
Open in the MATLAB editor:
g13aw_example
function g13aw_example
fprintf('g13aw example results\n\n');
type = int64(1);
p = int64(1);
y = [ -217; -177; -166; -136; -110; -95; -64; -37; -14; -25;
-51; -62; -73; -88; -113; -120; -83; -33; -19; 21;
17; 44; 44; 78; 88; 122; 126; 114; 85; 64];
[ts,ifail] = g13aw(type,p,y);
warn_state = nag_issue_warnings();
nag_issue_warnings(true);
n = int64(size(y,1));
[pvalue,~,ifail] = g01ew(type,n,ts);
nag_issue_warnings(warn_state);
fprintf('Dickey-Fuller test statistic = %6.3f\n', ts);
fprintf('associated p-value = %6.3f\n', pvalue);
g13aw example results
Dickey-Fuller test statistic = -2.540
associated p-value = 0.013
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015