ADF Test Specification

Given an observed time series ADF Time Series Dickey and Fuller consider three differential-form autoregressive equations to detect the presence of a unit root:

ADF Auto Regressions
  • t is the time index,

  • α is an intercept constant called a drift,

  • β is the coefficient on a time trend,

  • γ is the coefficient presenting process root, i.e. the focus of testing,

  • p is the lag order of the first-differences autoregressive process,

  • et is an independent identically distributes residual term.

The difference between the three equations concerns the presence of the deterministic elements α (a drift term) and βt (a linear time trend).

The focus of testing is whether the coefficient γ equals to zero, what means that the original ADF Time Series process has a unit root; hence, the null hypothesis of γ = 0 (random walk process) is tested against the alternative hypothesis γ < 0 of stationarity. More detailed, the null and alternative hypotheses corresponding to the models above are:

ADF Hypotheses

The ADF test ensures that the null hypothesis is accepted unless there is strong evidence against it to reject in favor of the alternate stationarity hypothesis.

ADF testing technique involves Ordinary Least Squares (OLS) method to find the coefficients of the model chosen. To estimate the significance of the coefficients in focus, the modified T (Student)-statistic (known as Dickey-Fuller statistic) is computed and compared with the relevant critical value: if the test statistic is less than the critical value then the null hypothesis is rejected. Each version of the test has its own critical value which depends on the size of the sample.

Restrictions and Recommendations

There are some drawbacks of the ADF test that require additional efforts to get reliable results.

  1. The ADF Test has low statistical power in distinguishing between true unit root processes (γ = 0) and near unit root processes (γ is close to zero). Also, several authors have shown that the ADF test tends to reject the non-stationarity hypothesis far too often, when the series have large (long-run) moving average processes. If there is evidence or doubt about such cases then it is recommended to additionally apply other stationarity tests (for instance, the KPSS Test) to ensure the results.

  2. Uncertainty about lags order, p, which has to be determined when applying the test. As it is shown by Perron (1989), including extra regressors of lagged first-differences does not affect the size of the test (probability of Type I Error) but decreases test power. On the contrary, too few lags may affect the size of the test. Perron suggested a procedure to define the adequate lag order. An alternative approach is to examine information criteria (such as the Bayesian, Hannan-Quinn, etc.) computed for different lags.

  3. Uncertainty about what test version to use, i.e. about including the intercept and time trend terms. Inappropriate exclusion or inclusion of these terms substantially affects test reliability. Using of prior knowledge (for instance, as result of visual inspection of a given time series) about whether the intercept and time trend should be included is the mostly recommended (but not always possible) informal way to overcome the difficulty mentioned. The more formal (algorithmic) approach is known as testing strategy and requires several additional experiments (series of ordered tests) to decide what model is adequate for a given observed process. There are several testing strategies developed, the most known of them are those suggested by Dolado et al. (1990), by Elder and Kennedy (2001) and by Enders (2004).

ADF Test Implementation and Usage

The ADFTest class implements ADF Test procedure according to the specification above. This class inherits from the OneSampleTest class.

The following constructor creates an instance of the ADFTest class.




set significanceLevel, numberOfLags, and model type

Initializes an instance of ADFTest class for the input parameters specified:

series contains time series observations (sample) to be tested for the presence of a unit root, the last element must correspond to the most recent observation,

significanceLevel is the desired significance level of the test in the range 0.001 – 0.999,

numberOfLags is the non-negative integer indicating the number of lagged changes of series to include in the model,

modelType specifies test version (model type), one of the members listed in the ADFTest..::..TimeSeriesModelType enumeration.

ModelTypeAR defines 'pure' autoregresression corresponding to the equation (1) in the specification, ModelTypeARD defines using of the model with a drift according to the equation (2) of the specification, ModelTypeTS defines using of the model which includes a drift and a time trend according to the equation (3).

method ADFTest(Double, Int32, ADFTest..::..TimeSeriesModelType)

The following public properties provide the details about the model and decision made:





The result of testing: takes true if the random walk null hypothesis is accepted while the false value means rejecting of the null hypothesis in favor of the alternative hypothesis of stationarity.

Property Decision


Shows the value of ADF statistic.

Property Statistic


The probability of obtaining a test statistic at least as extreme as the one that was actually observed, assuming that the null hypothesis is true.

Property PValue


Shows the critical value of the ADF statistic at the input significance level.

Property CValue


The sum of squared errors.

Property SSE


The intercept constant or drift.

Property Alpha


The coefficient β on a time trend.

Property Beta


The coefficient presenting the process' root, i.e. the focus of testing (the γ in the specification).

Property Gamma


The vector of coefficients of lagged derivatives ( δj , j = 1 ... p in the specification).

Property Delta

region of acceptance

We fail to reject null hypothesis if test statistics is between left and right borders of region of acceptance.

Region of acceptance left border:

Property AcceptanceRegionLeft

Region of acceptance right border:

Property AcceptanceRegionRight


There is also the indicator-style implementation of the ADF Test available in the Financial Analysis library and referred to as

C# Copy imageCopy
That implementation is more adopted to handle time series data either in expanding or sliding window manner. See the corresponding documentation for details.

Code Sample

The example of ADFTest class usage:

C# Copy imageCopy
 1using System;
 2using FinMath.LinearAlgebra;
 3using FinMath.Statistics.HypothesisTesting;
 5namespace FinMath.Samples
 7    class ADFTestSample
 8    {
 9        static void Main()
10        {
11            // Generate random series.
12            Vector series = Vector.Random(100);
14            // Create an instance of ADFTest.
15            ADFTest test = new ADFTest(0.05, 2, ADFTest.TimeSeriesModelType.ModelTypeTS);
16            test.Update(series);
18            Console.WriteLine("Test Result:");
19            // Test's decision.
20            Console.WriteLine("  Stationary? = {0}", !test.Decision);
21            // The statistic of ADF test.
22            Console.WriteLine("  Statistics = {0:0.000}", test.Statistic);
23            // The c-value of the test statistic.
24            Console.WriteLine("  C-Value = {0:0.000}", test.CValue);
25            // The p-value of the test statistic.
26            Console.WriteLine("  P-Value = {0:0.000}", test.PValue);
28            Console.WriteLine("Model Details:");
29            // The intercept constant or drift.
30            Console.WriteLine("  Alpha = {0:0.000}", test.Alpha);
31            // The coefficient on a time trend.
32            Console.WriteLine("  Beta = {0:0.000}", test.Beta);
33            // The coefficient presenting the process' root, i.e. the focus of testing.
34            Console.WriteLine("  Gamma = {0:0.000}", test.Gamma);
35            // The vector of coefficients of lagged derivatives.
36            Console.WriteLine("  Delta = ({0:0.000})", test.Delta);
38            Console.WriteLine("Extra Information:");
39            // The sum of squared errors.
40            Console.WriteLine("  SSE = {0:000}", test.SSE);
41        }
42    }

See Also