Products & Services Solutions Academia Support User Community Company

Learn more about Econometrics Toolbox   

adftest - Augmented Dickey-Fuller test for unit root

Syntax

h = adftest(y)
h = adftest(y,'ParameterName',ParameterValue,...)
[h,pValue] = adftest(...)
[h,pValue,stat] = adftest(...)
[h,pValue,stat,cValue] = adftest(...)
[h,pValue,stat,cValue,reg] = adftest(...)

Description

h = adftest(y) assesses the null hypothesis of a unit root in a univariate time series y.

h = adftest(y,'ParameterName',ParameterValue,...) accepts optional inputs as one or more comma-separated parameter-value pairs. 'ParameterName' is the name of the parameter inside single quotes. ParameterValue is the value corresponding to 'ParameterName'. Specify parameter-value pairs in any order; names are case-insensitive. Perform multiple tests by passing a vector value for any parameter. Multiple tests yield vector results.

[h,pValue] = adftest(...) returns p-values of the test statistics.

[h,pValue,stat] = adftest(...) returns the test statistics.

[h,pValue,stat,cValue] = adftest(...) returns critical values for the tests.

[h,pValue,stat,cValue,reg] = adftest(...) returns a structure of regression statistics.

Inputs

y

Vector of time-series data. The last element is the most recent observation. The test ignores NaN values, which indicate missing entries.

Parameter/Value Pairs

'alpha'

Scalar or vector of nominal significance levels for the tests. Set values between 0.001 and 0.999.

Default: 0.05

'lags'

Scalar or vector of nonnegative integers indicating the number of lagged changes of y to include in the model.

For best results, give a suitable value for 'lags'. For information on selecting 'lags', see Determine Appropriate Lags.

Default: 0

'model'

String or cell vector of strings indicating the model variant. For information on selecting 'model', see Choose Models to Test. Values are:

  • 'AR' (autoregressive)

    adftest tests the null model

    yt = yt – 1 + b1Δyt – 1 + b2Δyt – 2 + ... + bpΔytp + e(t).

    against the alternative model

    yt = ayt – 1 + b1Δyt – 1 + b2Δyt – 2 + ... + bpΔytp + e(t).

    with AR(1) coefficient a < 1.

  • 'ARD' (autoregressive with drift)

    adftest tests the 'AR' null model against the alternative model

    yt = c + ayt – 1 + b1Δyt – 1 + b2Δyt – 2 + ... + bpΔytp + e(t).

    with drift coefficient c and AR(1) coefficient a < 1.

  • 'TS' (trend stationary)

    adftest tests the null model

    yt = c + yt – 1 + b1Δyt – 1 + b2Δyt – 2 + ... + bpΔytp + e(t).

    against the alternative model

    yt = c + dt + ayt – 1 + b1Δyt – 1 + b2Δyt – 2 + ... + bpΔytp + e(t).

    with drift coefficient c, deterministic trend coefficient d, and AR(1) coefficient a < 1.

Default: 'AR'

'test'

String or cell vector of strings indicating the test statistic. Values are:

  • 't1'

    adftest computes a standard t statistic

    t1 = (a – l)/se

    from OLS estimates of the AR(1) coefficient and its standard error (se) in the alternative model. The test assesses the significance of the restriction a – 1 = 0.

  • 't2'

    adftest computes a lag-adjusted, "unstudentized" t statistic

    t2 = T (a – 1)/(1– b1– ...– bp)

    from OLS estimates of the AR(1) coefficient and the stationary coefficients in the alternative model. T is the effective sample size, adjusted for lags and missing values. The test assesses the significance of the restriction a – 1 = 0.

  • 'F'

    adftest computes an F statistic to assess the significance of a joint restriction on the alternative model. If the value of 'model' is 'ARD', the restriction is a – 1 = 0 and c = 0. If the value of 'model' is 'TS', the restriction is a – 1 = 0 and d = 0. An F test is invalid when the value of 'model' is 'AR'.

Default: 't1'

Outputs

h

Vector of Boolean decisions for the tests, with length equal to the number of tests. Values of h equal to 1 indicate rejection of the unit-root null in favor of the alternative model. Values of h equal to 0 indicate a failure to reject the unit-root null.

pValue

Vector of p-values of the test statistics, with length equal to the number of tests. When the value of 'test' is 't1' or 't2', p-values are left-tail probabilities. When the value of 'test' is 'F', p-values are right-tail probabilities.

stat

Vector of test statistics, with length equal to the number of tests. adftest computes statistics using OLS estimates of the coefficients in the alternative model.

cValue

Vector of critical values for the tests, with length equal to the number of tests. When the value of 'test' is 't1' or 't2', critical values are for left-tail probabilities. When the value of 'test' is 'F', critical values are for right-tail probabilities.

reg

Structure of regression statistics for the OLS estimation of coefficients in the alternative model. The number of records is equal to the number of tests. Each record has the following fields:

numLength of input series with NaNs removed
sizeEffective sample size, adjusted for lags
namesRegression coefficient names
coeffEstimated coefficient values
seEstimated coefficient standard errors
CovEstimated coefficient covariance matrix
tStatst statistics of coefficients and p-values
FStatF statistic and p-value
yMuMean of the lag-adjusted input series
ySigmaStandard deviation of the lag-adjusted input series
yHatFitted values of the lag-adjusted input series
resRegression residuals
DWStatDurbin-Watson statistic
SSRRegression sum of squares
SSEError sum of squares
SSTTotal sum of squares
MSEMean square error
RMSEStandard error of the regression
RSqR^2 statistic
aRSqAdjusted R^2 statistic
LLLoglikelihood of data under Gaussian innovations
AICAkaike information criterion
BICBayesian (Schwarz) information criterion
HQCHannan-Quinn information criterion

Definitions

The Dickey-Fuller model is

yt = c + dt + a yt – 1 + b1Δyt – 1 + b2Δyt – 2 +...+ bpΔytp + e(t).

where

The null hypothesis restricts a = 1.

The test assesses the null hypothesis under the model variant appropriate for series with different growth characteristics (c = 0 or d = 0). Lagged differences bkΔytk, k = 1, ..., p, "augment" the test to account for serial correlations in the innovations process e(t).

Examples

Test log GDP data for a unit root using a trend-stationary alternative with 0 to 2 lagged differences:

load unitRootData
y = log(GDP);
h = adftest(y,'model','TS','Lags',0:2)

The test returns

h =
     0     0     0

The test fails to reject the unit-root null for each alternative.

Algorithm

adftest performs a least-squares regression to estimate coefficients in the null model.

Dickey-Fuller statistics follow nonstandard distributions under the null, even asymptotically. Critical values for a range of sample sizes and significance levels have been tabulated using Monte Carlo simulations of the null model with Gaussian innovations. For small samples, values are valid only for Gaussian innovations; for large samples, values are also valid for non-Gaussian innovations. adftest interpolates critical values and p-values from the tables. Tables for tests of type 't1' and 't2' are identical to those for pptest.

References

[1] Davidson, R. and J. G. MacKinnon. Econometric Theory and Methods. Oxford, UK: Oxford University Press, 2004.

[2] Dickey, D. A., and W. A. Fuller. "Distribution of the Estimators for Autoregressive Time Series with a Unit Root." Journal of the American Statistical Association. Vol. 74, 1979, pp. 427–431.

[3] Dickey, D. A., and W. A. Fuller. "Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root." Econometrica. Vol. 49, 1981, pp. 1057–1072.

[4] Elder, J., and P. E. Kennedy. "Testing for Unit Roots: What Should Students Be Taught?" Journal of Economic Education. Vol. 32, 2001, pp. 137–146.

[5] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

[6] Ng, S., and P. Perron. "Unit Root Tests in ARMA Models with Data-Dependent Methods for the Selection of the Truncation Lag." Journal of the American Statistical Association. Vol. 90, 1995, pp. 268–281.

[7] Schwert, W. "Tests for Unit Roots: A Monte Carlo Investigation." Journal of Business and Economic Statistics. Vol. 7, 1989, pp. 147–159.

See Also

kpsstest | pptest | vratiotest

How To

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS