lmctest
LeybourneMcCabe stationarity test
Syntax
h = lmctest(y)
h = lmctest(y,'ParameterName',ParameterValue)
[h,pValue]
= lmctest(...)
[h,pValue,stat]
= lmctest(...)
[h,pValue,stat,cValue]
= lmctest(...)
[h,pValue,stat,cValue,reg1]
= lmctest(...)
[h,pValue,stat,cValue,reg1,reg2]
= lmctest(...)
Description
h = lmctest(y) assesses
the null hypothesis that
a univariate time series y is a trend stationary
AR(p) process, against the alternative that it
is a nonstationary ARIMA(p,1,1) process.
h = lmctest(y,'ParameterName',ParameterValue) accepts
one or more commaseparated parameter name/value pairs. Specify ParameterName inside
single quotes. Perform multiple tests by passing a vector value for
any parameter. Multiple tests yield vector results.
[h,pValue]
= lmctest(...) returns pvalues of the
test statistics.
[h,pValue,stat]
= lmctest(...) returns the test statistics.
[h,pValue,stat,cValue]
= lmctest(...) returns critical values for the tests.
[h,pValue,stat,cValue,reg1]
= lmctest(...) returns a structure of regression statistics
from the maximum likelihood estimation of the reducedform model.
[h,pValue,stat,cValue,reg1,reg2]
= lmctest(...) returns a structure of regression statistics
from the OLS estimation of the filtered data on a linear trend.
y 
Vector of timeseries data. The last element is the most recent
observation. The test ignores NaN values, which indicate missing entries.

NameValue Pair Arguments
'alpha' 
Scalar or vector of nominal significance levels for the tests.
Set values between 0.01 and 0.1.
Default: 0.05 
'Lags' 
Scalar or vector of nonnegative integers indicating the number p of
lagged values of y to include in the structural
model (equal to the number p of lagged changes
of y in the reducedform model).
For best results, give a suitable value for 'lags'.
For information on selecting 'lags', see Determine Appropriate Lags.
Default: 0 
'trend' 
Scalar or vector of Boolean values indicating whether or not
to include the deterministic trend term d*t in
the structural model (equivalent to including the drift term d in
the reducedform model).
Determine the value of trend by the growth
characteristics of the time series y. Choose trend with
a specific testing strategy in mind. If y is
growing, set trend to true to provide
a reasonable comparison of a trendstationary null and a unitroot
process with drift. If y does not exhibit
longterm growth characteristics, set trend to false.
Default: true 
'test' 
String or cell vector of strings indicating which estimate of the variance
to use in computing the test
statistic. Values are 'var1' or 'var2'.
Default: 'var2' 
Output Arguments
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 AR(p) null in favor
of the ARIMA(p,1,1) alternative. Values of h equal
to 0 indicate a failure to reject the AR(p) null.

pValue 
Vector of pvalues of the test statistics,
with length equal to the number of tests. Values are righttail probabilities.

stat 
Vector of test statistics, with length equal to the number of
tests. For details, see Test Statistics.

cValue 
Vector of critical values for the tests, with length equal to
the number of tests. Values are for righttail probabilities.

reg1 
Structure of regression statistics from the maximum likelihood
estimation of the reducedform model. The structure is described in Regression Statistics Structure.

reg2 
Structure of regression statistics The structure is described
in Regression Statistics Structure.

Examples
expand all
Test the growth of the U.S. unemployment rate using the data in Schwert, 1987.
Load Schwert's macroeconomic data set.
load Data_SchwertMacro
Focus on the unemployment rate growth over the dates condsidered in Leybourne and McCabe, 1999.
UN = DatasetMth.UN;
t1 = find(datesMth == datenum([1948 01 01]));
t2 = find(datesMth == datenum([1985 12 01]));
dUN = diff(UN(t1:t2)); % Unemployment rate growth
Assess the null hypothesis that the unemployment rate growth is a trend stationary, AR(1) process using the estimated variance from OLS regression.
[h1,~,stat1,cValue] = lmctest(dUN,'lags',1,'test','var1')
Warning: Test statistic #1 below tabulated critical values:
maximum pvalue = 0.100 reported.
h1 =
0
stat1 =
0.0992
cValue =
0.1460
The warning indicates that the pvalue is below 0.1. h1 = 0 indicates that there is not enough evidence to reject that the unemployment rate growth is a trend stationary, AR(1) process.
Assess the null hypothesis that the unemployment rate growth is a trend stationary, AR(1) process using the estimated variance from the maximum liklihood of the reducedform regression model.
[h2,~,stat2,cValue] = lmctest(dUN,'lags',1,'test','var2')
h2 =
1
stat2 =
0.1874
cValue =
0.1460
h2 = 1 indicates that the there is enough evidence to asuggest that the unemployment rate growth is nonstationary.
Leybourne and McCabe, 1999 report that the original LMC statistic fails to reject stationarity, while the modified LMC statistic does reject it.
More About
expand all
lmctest uses the structural model
where
and u_{1} and u_{2} are
independent of each other.
The model is secondorder equivalent in moments to the reducedform
ARIMA(p,1,1) model
(1 – L)y(t)
= δ + b_{1}(1
– L)y(t –
1) + ... + b_{p}(1 – L)y(t – p)
+ (1 – aL)v(t),
where L is the lag operator Ly(t) = y(t–1),
and v(t) ~ i.i.d(0,σ^{2}).
The null hypothesis is that σ^{2} = 0 in the structural
model, which is equivalent to a = 1 in the reducedform
model. The alternative is that σ^{2} > 0 or a < 1. Under the
null, the structural model is AR(p) with intercept c(0)
and trend δt; the reducedform model is an
overdifferenced ARIMA(p,1,1) representation of
the same process.
lmctest computes test statistics using
a twostage method that first finds maximum likelihood estimates (MLEs)
of coefficients in the reducedform model. It then regresses the filtered
data
z(t) = y(t)
– b_{1}y(t–1)
– ... – b_{p}y(t–p)
on an intercept and, if 'trend' is true,
on a trend. It forms the stat test statistic using
the residuals e from the first regression as follows:
where V(i,j) = min(i,j), s^{2} is
an estimate of
that depends on
the value of test (estimate of the variance), and T is
the effective sample size.
You can choose between test values of 'var1' and 'var2'.
These distinguish between the algorithm for estimating the variance
.
'var1' — The estimate is (e'*e)/T,
where e is the residual vector from the OLS regression reg2 and T is
the effective sample size. This is the original LeybourneMcCabe test
described in [3], with a rate of consistency O(T).
'var1' — The estimate is a*σ^{2},
where a and σ^{2} are
MLEs from the estimation reg1 of the reducedform
model. This is the modified LeybourneMcCabe test described in [4], with a rate of consistency O(T^{2}).
Lagging and differencing a time series reduces the sample size.
Absent any presample values, if y(t) is
defined for t = 1:N, then the lagged series y(t–k) is
defined for t = k+1:N.
Differencing reduces the time base to k+2:N. With p lagged
differences, the common time base is p+2:N and
the effective sample size is N – (p+1).
The maximum likelihood estimation of reg1 regresses Y = (1–L)y(t),
with num = N–1,
on p lagged changes of y, so
that size = N – (p+1).
The OLS estimation of reg2 regresses Y = z(t),
with num = N–p,
on an intercept and, if trend is true,
a trend, so that size = num.
The regression statistics structures have the following form:
num  Length of input series with NaNs removed 
size  Effective sample size, adjusted for lags and difference 
names  Regression coefficient names 
coeff  Estimated coefficient values 
se  Estimated coefficient standard errors 
Cov  Estimated coefficient covariance matrix 
tStats  t statistics of coefficients and pvalues 
FStat  F statistic and pvalue 
yMu  Mean of the lagadjusted input series 
ySigma  Standard deviation of the lagadjusted input series 
yHat  Fitted values of the lagadjusted input series 
res  Regression residuals 
DWStat  DurbinWatson statistic 
SSR  Regression sum of squares 
SSE  Error sum of squares 
SST  Total sum of squares 
MSE  Mean square error 
RMSE  Standard error of the regression 
RSq  R^{2} statistic 
aRSq  Adjusted R^{2} statistic 
LL  Loglikelihood of data under Gaussian innovations 
AIC  Akaike information criterion 
BIC  Bayesian (Schwarz) information criterion 
HQC  HannanQuinn information criterion 
Test statistics follow nonstandard distributions under the null,
even asymptotically. Asymptotic critical values for a standard set
of significance levels between 0.01 and 0.1, for models with and without
a trend, have been tabulated in [2] using
Monte Carlo simulations. Critical values and pvalues
reported by lmctest are interpolated from the
tables. Tables are identical to those for kpsstest.
[1] shows that bootstrapped critical values, used by
tests with a unit root null (such as adftest and pptest),
are not possible for lmctest. As a result, size
distortions for small samples may be significant, especially for highly
persistent processes.
[3] shows that the test is robust when p takes
values greater than the value in the datagenerating process. [3] also notes simulation evidence that, under the
null, the marginal distribution of the MLE of b_{p} is
asymptotically normal, and so may be subject to a standard ttest
for significance. Estimated standard errors, however, are unreliable
in cases where the MA(1) coefficient a is near
1. As a result, [4] proposes another test for model order, valid under
both the null and the alternative, that relies only on the MLEs of b_{p} and a,
and not on their standard errors.
References
[1] Caner, M., and L. Kilian. "Size Distortions
of Tests of the Null Hypothesis of Stationarity: Evidence and Implications
for the PPP Debate." Journal of International Money
and Finance. Vol. 20, 2001, pp. 639–657.
[2] Kwiatkowski, D., P. C. B. Phillips, P.
Schmidt and Y. Shin. "Testing the Null Hypothesis of Stationarity
against the Alternative of a Unit Root." Journal
of Econometrics. Vol. 54, 1992, pp. 159–178.
[3] Leybourne, S. J., and B. P. M. McCabe. "A
Consistent Test for a Unit Root." Journal of Business
and Economic Statistics. Vol. 12, 1994, pp. 157–166.
[4] Leybourne, S. J., and B. P. M. McCabe. "Modified
Stationarity Tests with DataDependent ModelSelection Rules." Journal
of Business and Economic Statistics. Vol. 17, 1999, pp.
264–270.
[5] Schwert, G. W. "Effects of Model
Specification on Tests for Unit Roots in Macroeconomic Data." Journal
of Monetary Economics. Vol. 20, 1987, pp. 73–103.
See Also
adftest  kpsstest  pptest  vratiotest