| Contents | Index |
h = adftest(Y) returns a logical with the rejection decision from testing the null hypothesis of a unit root in a univariate time series, Y.
h = adftest(Y,Name,Value) returns the rejection decision for the null hypothesis with additional options specified by one or more Name,Value pair arguments.
If any Name,Value argument is a vector, then adftest(Y,Name,Value) treats each element as a separate test, returning a vector of rejection decisions.
If any Name,Value argument is a vector, then all Name,Value arguments specified must be vectors of equal length or length one.
If any Name,Value argument is a row vector, then adftest(Y,Name,Value) returns a row vector.
Test Canadian inflation rate (based on CPI) for a unit root using the default autoregression model with no added difference terms.
Load the Canadian inflation rate data.
load Data_Canada
Y = Dataset.INF_C;Test for a unit root.
h = adftest(Y)
h =
0The test fails to reject the null hypothesis of a unit root against the autoregressive alternative.
Test log GDP data for a unit root using a trend-stationary alternative with 0 to 2 lagged differences.
Load the GDP data, and calculate the log.
load Data_GDP;
Y = log(Data);Test for a unit root using three lag choices.
h = adftest(Y,'model','TS','lags',0:2)
h =
0 0 0
The test fails to reject the null hypothesis of a unit root against the trend-stationary alternative for all three lags.
Test log GDP data for a unit root using a trend-stationary alternative with 0 to 2 lagged differences. Look at the regression statistics for the alternative models to choose the best number of lags.
Load the GDP data, and calculate the log.
load Data_GDP;
Y = log(Data);Test for a unit root using three lag choices. Output the regression statistics for the alternative model.
[h,~,~,~,reg] = adftest(Y,'model','TS','lags',0:2);
The output reg is an array of three data structures, corresponding to each alternative model.
Display the names of the coefficients included in each of the three alternatives.
reg.names
ans =
'c'
'd'
'a'
ans =
'c'
'd'
'a'
'b1'
ans =
'c'
'd'
'a'
'b1'
'b2'The first model has no added difference terms (a lag of 0), the second model has one difference term (a lag of 1), and the third model has two difference terms (a lag of 2).
Display the t statistics and corresponding p-values for each coefficient in the three alternative models.
[reg(1).tStats.t reg(1).tStats.pVal]
ans =
2.0533 0.0412
1.8842 0.0608
61.4717 0.0000[reg(2).tStats.t reg(2).tStats.pVal]
ans =
2.9026 0.0041
2.7681 0.0061
64.1396 0.0000
5.6514 0.0000[reg(3).tStats.t reg(3).tStats.pVal]
ans =
3.2568 0.0013
3.1249 0.0020
62.7825 0.0000
4.7586 0.0000
1.7615 0.0795The coefficient on the first difference term is significantly different from zero, but the coefficient on the second term is not. This suggests augmenting the model with 1 lag is adequate.
Compare the BIC for each of the three alternatives.
reg.BIC
ans = -1.4774e+03 ans = -1.4966e+03 ans = -1.4878e+03
The alternative model augmented with one difference term has the best (that is, the smallest) BIC value.
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
Example: 'lags',0:2,'alpha',0.1 specifies three tests at lags 0, 1, and 2, all conducted at the 0.1 significance level
h | Test rejection decisions Test rejection decisions, returned as a logical or vector of logicals with length equal to the number of tests conducted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
pValue | Test statistic p-values Test statistic p-values, returned as a scalar or vector with length equal to the number of tests conducted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
stat | Test statistics Test statistics, returned as a scalar or vector with length equal to the number of tests conducted. adftest computes test statistics using OLS estimates of the coefficients in the alternative model. | ||||||||||||||||||||||||||||||||||||||||||||||||||
cValue | Critical values Critical values, returned as a scalar or vector with length equal to the number of tests conducted.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
reg | Regression statistics Regression statistics for OLS estimation of coefficients in the alternative model, returned as a data structure or data structure array with length equal to the number of tests conducted. Each data structure has the following fields.
|
The Augmented Dickey-Fuller test assesses the null hypothesis of a unit root using the model
![]()
where
Δ is the differencing operator, such that
![]()
The number of lagged difference terms, p, is user specified.
εt is a mean zero innovation process.
The null hypothesis of a unit root is
![]()
Under the alternative hypothesis,
![]()
Variants of the model allow for different growth characteristics. The model with δ = 0 has no trend component, and the model with c = 0 and δ = 0 has no drift or trend.
A test that fails to reject the null hypothesis, fails to reject the possibility of a unit root.
adftest performs ordinary least squares (OLS) regression to estimate the coefficients in the alternative model.
Dickey-Fuller statistics follow nonstandard distributions under the null hypothesis (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, with five million replications per sample size.
For small samples, the tabulated critical values are only valid for Gaussian innovations. For large samples, the tabulated values are still valid for non-Gaussian innovations.
adftest interpolates critical values and p-values from the tables. The tables for test types 't1' and 't2' are identical to those for pptest.
i10test | kpsstest | lmctest | pptest | vratiotest
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-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |