| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| R2010b Documentation → Econometrics Toolbox |
| Contents | Index |
| Learn more about Econometrics Toolbox |
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.
y |
Vector of time-series data. The last element is the most recent observation. The test ignores NaN values, which indicate missing entries. |
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 reduced-form 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 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. Default: true |
test |
String or cell vector of strings indicating which estimate of the variance
Default: 'var2' |
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 p-values of the test statistics, with length equal to the number of tests. Values are right-tail 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 right-tail probabilities. |
reg1 |
Structure of regression statistics from the maximum likelihood estimation of the reduced-form model. The structure is described in Regression Statistics Structure. |
reg2 |
Structure of regression statistics The structure is described in Regression Statistics Structure. |
lmctest uses the structural model
![]()
where

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) = d + 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 dt; 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 [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 reduced-form model. This is the modified Leybourne-McCabe test described in [4], 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 |
| res | Regression residuals |
| DWStat | Durbin-Watson 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 | R2 statistic |
| 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 the growth of the U.S. unemployment rate, using the data in [5] % over the dates considered in [4]: load Data_SchwertMacro UN = DatasetMth.UN; t1 = find(datesMth == datenum([1948 01 01])); t2 = find(datesMth == datenum([1985 12 01])); y = diff(UN(t1:t2)); [h1,~,stat1,cValue] = lmctest(y,'lags',1,'test','var1') [h2,~,stat2,cValue] = lmctest(y,'lags',1,'test','var2')
As reported in [4], the original LMC statistic fails to reject stationarity, while the modified LMC statistic does reject it.
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 p-values 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 data-generating process. [3] 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, [4] 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.
[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 Data-Dependent Model-Selection 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.
adftest | kpsstest | 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-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |