naginterfaces.library.tsa.uni_​dickey_​fuller_​unit

naginterfaces.library.tsa.uni_dickey_fuller_unit(ut_type, p, y)[source]

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

For full information please refer to the NAG Library document for g13aw

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g13/g13awf.html

Parameters
ut_typeint

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.

pint

, 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.

yfloat, array-like, shape

, the time series.

Returns
tsfloat

The (augmented) Dickey–Fuller test statistic: when ; when or when .

Raises
NagValueError
(errno )

On entry, .

Constraint: , or .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: if , if , if ,

Warns
NagAlgorithmicWarning
(errno )

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.

(errno )

standard error of the parameter estimate is zero, therefore, depending on the sign of the parameter estimate, a large positive or negative value has been returned.

Notes

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. uni_dickey_fuller_unit 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 stat.prob_dickey_fuller_unit.

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