| Title: | Multivariate ARDL Unit Root Test |
|---|---|
| Description: | Implements the multivariate autoregressive distributed lag (ARDL) unit root test of Sam, McNown, Goh and Goh (2025) <doi:10.1080/03796205.2024.2439101>. The test augments the ADF regression with the lagged level, the current difference and lagged differences of one or more covariates so that cointegration between the series under test and the covariates is taken into account. The t statistic on the lagged level of the series and the joint F statistic on the lagged levels of the covariates are bootstrapped with the respective null imposed (residual bootstrap), giving critical values and p-values. Provides automatic lag selection via AIC or BIC, diagnostic plots, and the four-case classification of the order of integration of the series. |
| Authors: | Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>) |
| Maintainer: | Muhammad Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.1.1 |
| Built: | 2026-11-02 13:20:07 UTC |
| Source: | https://github.com/muhammedalkhalaf/mvardlurt |
Implements the multivariate autoregressive distributed lag (ARDL) unit root test of Sam, McNown, Goh and Goh (2025). The test augments the ADF regression with the lagged level, the current difference and lagged differences of one or more covariates, so that a possible cointegrating relationship between the series under test and the covariates is taken into account. Critical values and p-values come from the residual bootstrap described in the paper.
The main function is mvardlurt, which performs the multivariate
ARDL unit root test. The package provides:
Automatic lag selection via AIC or BIC on a common sample
Residual bootstrap critical values and p-values with the null imposed (Section 4.2 of the paper)
Three deterministic specifications (none, intercept, intercept + trend)
One or several covariates (joint F test on their lagged levels)
Four-case classification of the order of integration of y
Comprehensive print and summary output
Diagnostic plots
The test produces two statistics:
t-statistic: Tests on the lagged
level of y
F-statistic: Tests jointly on the
lagged levels of the covariates
The four cases of Section 3.2 of the paper are:
Case I: neither rejected; y is I(1), no cointegration
Case II: t rejected, F not rejected; y is I(0)
Case III: t not rejected, F rejected; y is I(2)
Case IV: both rejected; y is I(1) and cointegrated with x
Muhammad Alkhalaf
Sam, C. Y., McNown, R., Goh, S. K. and Goh, K. L. (2025). A multivariate autoregressive distributed lag unit root test. Studies in Economics and Econometrics, 49(1), 17-33. doi:10.1080/03796205.2024.2439101
# Generate cointegrated data set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) # Run the test result <- mvardlurt(y, x, case = 3, fixlag = c(2, 2), nboot = 199) print(result)# Generate cointegrated data set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) # Run the test result <- mvardlurt(y, x, case = 3, fixlag = c(2, 2), nboot = 199) print(result)
Creates a 2x2 panel of diagnostic plots for the multivariate ARDL unit root test including residuals vs fitted, Q-Q plot, residuals over time, and ACF.
## S3 method for class 'mvardlurt' autoplot(x, ...)## S3 method for class 'mvardlurt' autoplot(x, ...)
x |
An object of class |
... |
Additional arguments passed to plotting functions. |
Invisibly returns x.
Muhammad Alkhalaf
set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, fixlag = c(2, 2), nboot = 99) autoplot.mvardlurt(result)set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, fixlag = c(2, 2), nboot = 99) autoplot.mvardlurt(result)
Implements the multivariate autoregressive distributed lag (ARDL) unit root test of Sam, McNown, Goh and Goh (2025). The test augments the ADF regression with the lagged level, the current difference and lagged differences of one or more covariates, so that a possible cointegrating relationship between the series under test and the covariates is taken into account. Critical values and p-values are obtained by the residual bootstrap of Section 4.2 of the paper.
mvardlurt(y, x, case = 3L, maxlag = 10L, ic = "aic", fixlag = NULL, nboot = 999L, level = 0.05, seed = NULL, boot = TRUE, reps = NULL)mvardlurt(y, x, case = 3L, maxlag = 10L, ic = "aic", fixlag = NULL, nboot = 999L, level = 0.05, seed = NULL, boot = TRUE, reps = NULL)
y |
A numeric vector or time series. The series under test. |
x |
A numeric vector, time series or numeric matrix with one column per covariate (the I(1) forcing variables of the paper). |
case |
Integer. Deterministic specification:
|
maxlag |
Integer. Maximum ARDL order for AIC/BIC selection. Default is 10. Must be between 1 and 12. |
ic |
Character. Information criterion for lag selection: |
fixlag |
Optional numeric vector of length 2, the fixed orders
|
nboot |
Integer. Number of bootstrap replications. Default is 999. Minimum is 99. |
level |
Numeric. Significance level of the two tests used for the case classification (0 to 1). Default is 0.05. |
seed |
Optional integer. If supplied, the random number generator is
seeded with it for the bootstrap and the caller's RNG state is restored on
exit. Default |
boot |
Logical. Whether to compute bootstrap critical values and
p-values. Default is |
reps |
Deprecated name for |
The test regression is equation (1) of the paper,
estimated by OLS on . The orders follow
equation (1) of the paper: an ARDL(p, q) model contains lagged
differences of y and lagged differences of x in addition to the
contemporaneous difference of x, so p and q are at least 1 and ARDL(1, 1)
contains no lagged differences at all. The paper is not consistent on this
point: equations (1) and (24) sum to and , whereas
Section 4.1 describes the ARDL(1, 1) data generating process as having one
lagged difference of each variable and Table 4 reports an ARDL(0, 2) model
with no lagged difference of y. This package follows equation (1); the
paper's ARDL(0, 2) corresponds to fixlag = c(1, 3) here, and
fixlag = c(p, q) in versions before 1.1.0 corresponds to
fixlag = c(p + 1, q + 1) in 1.1.0 (apart from the contemporaneous
difference of x, which earlier versions omitted).
Two statistics are computed (Section 3.3, equations (11) and (12) of the paper):
the t statistic on for against
(left tailed);
the F (Wald) statistic for the joint hypothesis
on the lagged levels of all covariates (right
tailed). With one covariate this equals the squared t statistic on
.
Their null distributions depend on nuisance parameters, so both are
bootstrapped separately with the respective null imposed: the restricted
regression (without for the t test, without for
the F test) is estimated, its recentred residuals are resampled with
replacement, a bootstrap series is generated recursively from the
restricted estimated equation with the observed x held fixed, and the
unrestricted regression is re-estimated on . The
contemporaneous difference of x, which equation (24) of the paper omits
although equation (1) has it, is included in the restricted regressions and
in the bootstrap, following equation (1). The initial values
are set to the observed y, so the
recursion starts at with the observed history.
Critical values
are the percentiles of the nboot bootstrap statistics, and the
bootstrap p-values are the proportions of bootstrap statistics at least as
extreme as the observed ones.
The lag orders p and q of the bootstrap are those of the test regression,
either fixed through fixlag or selected by AIC or BIC on the observed
data. They are held fixed in every bootstrap replication: the restricted
regression is estimated with these orders and the unrestricted regression
is re-estimated on with the same orders, and the lag
selection is not repeated on the bootstrap samples. This follows Section
4.2 of the paper, where the restricted regression (24) is estimated with
the lag length of the data generating process and equation (1) is
re-estimated on and . When the orders are selected
from the data, the bootstrap distribution therefore does not reflect the
selection step. In a Monte Carlo experiment by the package author (n = 100,
y and x independent random walks, 200 replications, 199 bootstrap
replications, 5 percent level) the rejection frequencies of the bootstrap
tests were 0.055 to 0.070 with fixed lag orders and 0.080 to 0.100 with
AIC selection (Monte Carlo standard error about 0.02). Fixing the orders
through fixlag avoids this source of size distortion.
The decision at significance level level classifies the series
according to the four cases of Section 3.2 of the paper:
Case I (t not rejected, F not rejected): nonstationary process, no cointegration; y is I(1).
Case II (t rejected, F not rejected): stationary process; y is I(0).
Case III (t not rejected, F rejected): degenerate lagged dependent variable; y is I(2).
Case IV (both rejected): nonstationary process with cointegration between y and x; y is I(1).
The Monte Carlo experiments of the paper use a 5 percent level for both
tests, which is the default here. In the empirical application of the paper
the F statistic is reported as significant at the 10 percent level and
cointegration is concluded (Section 6); set level = 0.10 to
reproduce that convention. Before version 1.1.0 level was a
confidence level (default 0.95); values of 0.5 or more are now rejected.
Lag orders are either fixed through fixlag or selected by AIC or BIC
over p = 1, ..., maxlag and q = 1, ..., maxlag. All candidate
models are estimated on the same observations (t = maxlag + 1, ...,
n) so that the criteria are comparable;
the selected model is then re-estimated on its own full sample.
An object of class "mvardlurt" containing:
tstat |
t statistic for |
fstat |
F statistic for |
t_pval, f_pval
|
Bootstrap p-values (NA when |
t_cv, f_cv
|
Bootstrap critical values at the 10, 5, 2.5 and 1 percent levels |
t_boot, f_boot
|
The bootstrap distributions |
b1, b1_se
|
Estimate and standard error of |
beta2, beta2_se
|
Estimates and standard errors of |
lr_mult |
Long-run multipliers |
opt_p, opt_q
|
Orders of the ARDL(p, q) model used |
case, casename
|
Deterministic case and its description |
nboot |
Number of bootstrap replications |
nobs |
Number of observations in the regression |
aic, bic, r_squared, adj_r_squared
|
Fit statistics of the model |
ic_table |
Matrix of information criteria for all (p, q) candidates
(NULL with |
decision |
List with the decision at |
model |
The fitted |
data |
The data frame of the test regression |
y, x
|
The data used (x as a matrix) |
residuals |
Residuals from the fitted model |
Muhammad Alkhalaf
Sam, C. Y., McNown, R., Goh, S. K. and Goh, K. L. (2025). A multivariate autoregressive distributed lag unit root test. Studies in Economics and Econometrics, 49(1), 17-33. doi:10.1080/03796205.2024.2439101
# Cointegrated data: y is I(1) through x (Case IV) set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, case = 3, fixlag = c(2, 2), nboot = 199) print(result) summary(result) # Automatic lag selection with two covariates X <- cbind(x, z = cumsum(rnorm(n))) result2 <- mvardlurt(y, X, maxlag = 3, nboot = 199) result2$fstat# Cointegrated data: y is I(1) through x (Case IV) set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, case = 3, fixlag = c(2, 2), nboot = 199) print(result) summary(result) # Automatic lag selection with two covariates X <- cbind(x, z = cumsum(rnorm(n))) result2 <- mvardlurt(y, X, maxlag = 3, nboot = 199) result2$fstat
Creates diagnostic plots for the multivariate ARDL unit root test.
## S3 method for class 'mvardlurt' plot(x, which = c(1, 2, 3, 4), ask = (length(which) > 1 && dev.interactive()), ...)## S3 method for class 'mvardlurt' plot(x, which = c(1, 2, 3, 4), ask = (length(which) > 1 && dev.interactive()), ...)
x |
An object of class |
which |
Integer vector indicating which plots to produce:
Default is |
ask |
Logical. If |
... |
Additional arguments passed to plotting functions. |
Invisibly returns x.
Muhammad Alkhalaf
set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, maxlag = 3, nboot = 99) # Default diagnostic plots plot(result, ask = FALSE) # IC surface plot plot(result, which = 6)set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, maxlag = 3, nboot = 99) # Default diagnostic plots plot(result, ask = FALSE) # IC surface plot plot(result, which = 6)
Print, summary, and accessor methods for objects of class "mvardlurt".
## S3 method for class 'mvardlurt' print(x, ...) ## S3 method for class 'mvardlurt' summary(object, ...) ## S3 method for class 'mvardlurt' coef(object, ...) ## S3 method for class 'mvardlurt' residuals(object, ...) ## S3 method for class 'mvardlurt' fitted(object, ...)## S3 method for class 'mvardlurt' print(x, ...) ## S3 method for class 'mvardlurt' summary(object, ...) ## S3 method for class 'mvardlurt' coef(object, ...) ## S3 method for class 'mvardlurt' residuals(object, ...) ## S3 method for class 'mvardlurt' fitted(object, ...)
x |
An object of class |
object |
An object of class |
... |
Additional arguments (ignored). |
print and summary invisibly return x/object.
coef returns a named numeric vector with b1, the
beta2 coefficient of each covariate and the corresponding long-run
multipliers lr_mult.
residuals returns the numeric vector of residuals from the fitted model.
fitted returns the numeric vector of fitted values.
Muhammad Alkhalaf
set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, fixlag = c(2, 2), nboot = 99) # Print method print(result) # Summary method summary(result) # Extract coefficients coef(result) # Extract residuals head(residuals(result)) # Extract fitted values head(fitted(result))set.seed(123) n <- 100 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) result <- mvardlurt(y, x, fixlag = c(2, 2), nboot = 99) # Print method print(result) # Summary method summary(result) # Extract coefficients coef(result) # Extract residuals head(residuals(result)) # Extract fitted values head(fitted(result))