Leybourne-McCabe stationarity test
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(...)
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 comma-separated 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 p-values 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 reduced-form 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.
Vector of time-series data. The last element is the most recent observation. The test ignores NaN values, which indicate missing entries.
Scalar or vector of nominal significance levels for the tests. Set values between 0.01 and 0.1.
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 reduced-form model).
For best results, give a suitable value for 'lags'. For information on selecting 'lags', see Determine Appropriate Lags.
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 reduced-form 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 trend-stationary null and a unit-root process with drift. If y does not exhibit long-term growth characteristics, set trend to false.
String or cell vector of strings indicating which estimate of the variance to use in computing the test statistic. Values are 'var1' or 'var2'.
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.
Vector of p-values of the test statistics, with length equal to the number of tests. Values are right-tail probabilities.
Vector of test statistics, with length equal to the number of tests. For details, see Test Statistics.
Vector of critical values for the tests, with length equal to the number of tests. Values are for right-tail probabilities.
Structure of regression statistics from the maximum likelihood estimation of the reduced-form model. The structure is described in Regression Statistics Structure.
Structure of regression statistics The structure is described in Regression Statistics Structure.
Test the growth of the U.S. unemployment rate using the data in Schwert, 1987.
Load Schwert's macroeconomic data set.
Focus on the unemployment rate growth over the dates condsidered in Leybourne and McCabe, 1999.
UN = DataTableMth.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 p-value = 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 reduced-form 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.
lmctest uses the structural model
and u1 and u2 are independent of each other.
The model is second-order equivalent in moments to the reduced-form ARIMA(p,1,1) model
(1 – L)y(t) = δ + b1(1 – L)y(t – 1) + ... + bp(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 reduced-form 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 reduced-form model is an over-differenced ARIMA(p,1,1) representation of the same process.
lmctest computes test statistics using a two-stage method that first finds maximum likelihood estimates (MLEs) of coefficients in the reduced-form model. It then regresses the filtered data
z(t) = y(t) – b1y(t–1) – ... – bpy(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), s2 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 Leybourne-McCabe test described in , 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 reduced-form model. This is the modified Leybourne-McCabe test described in , with a rate of consistency O(T2).
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 p-values|
|FStat||F statistic and p-value|
|yMu||Mean of the lag-adjusted input series|
|ySigma||Standard deviation of the lag-adjusted input series|
|yHat||Fitted values of the lag-adjusted input series|
|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|
|aRSq||Adjusted R2 statistic|
|LL||Loglikelihood of data under Gaussian innovations|
|AIC||Akaike information criterion|
|BIC||Bayesian (Schwarz) information criterion|
|HQC||Hannan-Quinn 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  using Monte Carlo simulations. Critical values and p-values reported by lmctest are interpolated from the tables. Tables are identical to those for kpsstest.
 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.
 shows that the test is robust when p takes values greater than the value in the data-generating process.  also notes simulation evidence that, under the null, the marginal distribution of the MLE of bp is asymptotically normal, and so may be subject to a standard t-test for significance. Estimated standard errors, however, are unreliable in cases where the MA(1) coefficient a is near 1. As a result,  proposes another test for model order, valid under both the null and the alternative, that relies only on the MLEs of bp and a, and not on their standard errors.
 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.
 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.
 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.
 Leybourne, S. J., and B. P. M. McCabe. "Modified Stationarity Tests with Data-Dependent Model-Selection Rules." Journal of Business and Economic Statistics. Vol. 17, 1999, pp. 264–270.
 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.