nag_tsa_dickey_fuller_unit (g13awc) (PDF version)
g13 Chapter Contents
g13 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_tsa_dickey_fuller_unit (g13awc)

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_tsa_dickey_fuller_unit (g13awc) returns the (augmented) Dickey–Fuller unit root test.

2  Specification

#include <nag.h>
#include <nagg13.h>
double  nag_tsa_dickey_fuller_unit (Nag_TS_URTestType type, Integer p, Integer n, const double y[], NagError *fail)

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. nag_tsa_dickey_fuller_unit (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, yt, for t=1,2,,n, has a unit root, the regression model
yt = β1 yt-1 + i=1 p-1 δi yt-i +εt  
is fitted and the test statistic τ constructed as
τ = β^1 σ11  
where  is the difference operator, with yt = yt- yt-1 , and where β^1 and σ11 are the least squares estimate and associated standard error for β1 respectively.
To test for a unit root with drift the regression model
yt = β1 yt-1 + i=1 p-1 δi yt-i +α +εt  
is fit and the test statistic τμ constructed as
τμ = β^1 σ11  
To test for a unit root with drift and deterministic time trend the regression model
yt = β1 yt-1 + i=1 p-1 δi yt-i +α +β2t +εt  
is fit and the test statistic ττ constructed as
ττ = β^1 σ11  
The distributions of the three test statistics; τ, τμ and ττ, are nonstandard. An associated probability can be obtained from nag_prob_dickey_fuller_unit (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:     type Nag_TS_URTestTypeInput
On entry: the type of unit test for which the probability is required.
type=Nag_UnitRoot
A unit root test will be performed and τ returned.
type=Nag_UnitRootWithDrift
A unit root test with drift will be performed and τμ returned.
type=Nag_UnitRootWithDriftAndTrend
A unit root test with drift and deterministic time trend will be performed and ττ returned.
Constraint: type=Nag_UnitRoot, Nag_UnitRootWithDrift or Nag_UnitRootWithDriftAndTrend.
2:     p IntegerInput
On entry: p, the degree of the autoregressive (AR) component of the Dickey–Fuller test statistic. When p>1 the test is usually referred to as the augmented Dickey–Fuller test.
Constraint: p>0.
3:     n IntegerInput
On entry: n, the length of the time series.
Constraints:
  • if type=Nag_UnitRoot, n>2p;
  • if type=Nag_UnitRootWithDrift, n>2p+1;
  • if type=Nag_UnitRootWithDriftAndTrend, n>2p+2.
4:     y[n] const doubleInput
On entry: y, the time series.
5:     fail NagError *Input/Output
The NAG error argument (see Section 2.7 in How to Use the NAG Library and its Documentation).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, n=value.
Constraint: n>value.
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.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_ORDERS_ARIMA
On entry, p=value.
Constraint: p>0.
NW_SOLN_NOT_UNIQUE
On entry, the design matrix used in the estimation of β1 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
σ11=0, therefore depending on the sign of β^1, a large positive or negative value has been returned.

7  Accuracy

None.

8  Parallelism and Performance

nag_tsa_dickey_fuller_unit (g13awc) is not threaded in any implementation.

9  Further Comments

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

Program Text (g13awce.c)

10.2  Program Data

Program Data (g13awce.d)

10.3  Program Results

Program Results (g13awce.r)


nag_tsa_dickey_fuller_unit (g13awc) (PDF version)
g13 Chapter Contents
g13 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016