| Title: | Multivariate ARDL Unit Root Test |
|---|---|
| Description: | Implements the multivariate autoregressive distributed lag (ARDL) unit root test proposed by Sam, McNown, Goh, and Goh (2024) <doi:10.1080/03796205.2024.2439101>. The test augments the standard ADF regression with lagged levels of a covariate to improve power when cointegration exists. Bootstrap critical values ensure correct size regardless of nuisance parameters. Provides automatic lag selection via AIC/BIC, diagnostic tests, and comprehensive inference tables following the four-case framework. |
| Authors: | Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>) |
| Maintainer: | Muhammad Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.2 |
| Built: | 2026-05-28 07:25:10 UTC |
| Source: | https://github.com/muhammedalkhalaf/mvardlurt |
Implements the multivariate autoregressive distributed lag (ARDL) unit root test proposed by Sam, McNown, Goh, and Goh (2024). The test augments the standard ADF regression with lagged levels of a covariate to improve power when cointegration exists. Bootstrap critical values ensure correct size regardless of nuisance parameters.
The main function is mvardlurt, which performs the multivariate
ARDL unit root test. The package provides:
Automatic lag selection via AIC or BIC
Bootstrap critical values for correct test size
Three deterministic specifications (none, intercept, intercept + trend)
Four-case decision framework for inference
Comprehensive print and summary output
Diagnostic plots
The test produces two statistics:
t-statistic: Tests (unit root)
F-statistic: Tests (no cointegration)
The four-case framework interprets results as:
Case I: Both reject Cointegration
Case II: Reject t, Accept F y may be I(0)
Case III: Accept t, Reject F Spurious
Case IV: Both accept No cointegration
Muhammad Alkhalaf
Sam, C. Y., McNown, R., Goh, S. K., & Goh, K. L. (2024). A multivariate autoregressive distributed lag unit root test. Studies in Economics and Econometrics, 1-17. 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, reps = 200) 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, reps = 200) 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, reps = 100) 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, reps = 100) autoplot.mvardlurt(result)
Implements the multivariate autoregressive distributed lag (ARDL) unit root test proposed by Sam, McNown, Goh, and Goh (2024). The test augments the standard ADF regression with lagged levels of a covariate (independent variable) to improve power, especially when cointegration exists. Bootstrap critical values ensure correct size regardless of nuisance parameters.
mvardlurt(y, x, case = 3L, maxlag = 10L, ic = "aic", fixlag = NULL, reps = 1000L, level = 0.95, seed = 12345L, boot = TRUE)mvardlurt(y, x, case = 3L, maxlag = 10L, ic = "aic", fixlag = NULL, reps = 1000L, level = 0.95, seed = 12345L, boot = TRUE)
y |
A numeric vector or time series. The dependent variable. |
x |
A numeric vector or time series. The independent variable (covariate). |
case |
Integer. Deterministic specification:
|
maxlag |
Integer. Maximum lag order for AIC/BIC selection. Default is 10. Must be between 0 and 10. |
ic |
Character. Information criterion for lag selection: |
fixlag |
Optional numeric vector of length 2, specifying fixed lag
orders |
reps |
Integer. Number of bootstrap replications. Default is 1000. Minimum is 100. |
level |
Numeric. Confidence level for inference (0 to 1). Default is 0.95. |
seed |
Integer. Random seed for reproducibility. Default is 12345. |
boot |
Logical. Whether to compute bootstrap critical values. Default
is |
The test estimates the following ARDL regression:
The test produces two statistics:
t-statistic: Tests (unit root in y)
F-statistic: Tests (no cointegration)
Based on the four-case framework (Sam et al., 2024):
Case I: Reject both Cointegration
Case II: Reject t, Accept F Degenerate case 1
(y may be I(0))
Case III: Accept t, Reject F Degenerate case 2
(spurious)
Case IV: Accept both No cointegration
An object of class "mvardlurt" containing:
tstat |
t-statistic for the unit root test (on |
fstat |
F-statistic for the cointegration test (on |
fstat_p |
Asymptotic p-value for the F-statistic |
pi_coef |
Coefficient estimate of |
pi_se |
Standard error of |
delta_coef |
Coefficient estimate of |
delta_se |
Standard error of |
lr_mult |
Long-run multiplier |
opt_p |
Selected lag order for |
opt_q |
Selected lag order for |
case |
Deterministic case used |
casename |
Description of the deterministic case |
reps |
Number of bootstrap replications |
nobs |
Number of observations used |
aic |
AIC value of the selected model |
bic |
BIC value of the selected model |
r_squared |
R-squared of the regression |
t_cv |
Bootstrap critical values for t-statistic (10%, 5%, 2.5%, 1%) |
f_cv |
Bootstrap critical values for F-statistic (10%, 5%, 2.5%, 1%) |
ic_table |
Matrix of IC values for all (p, q) combinations |
decision |
List containing test decisions and significance levels |
model |
The fitted |
y |
Original dependent variable |
x |
Original independent variable |
residuals |
Residuals from the fitted model |
Muhammad Alkhalaf
Sam, C. Y., McNown, R., Goh, S. K., & Goh, K. L. (2024). A multivariate autoregressive distributed lag unit root test. Studies in Economics and Econometrics, 1-17. doi:10.1080/03796205.2024.2439101
# Generate example data with cointegration set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) # Run the test (reduced reps for speed) result <- mvardlurt(y, x, case = 3, reps = 200) print(result) # With fixed lags result2 <- mvardlurt(y, x, fixlag = c(2, 2), reps = 200)# Generate example data with cointegration set.seed(123) n <- 200 x <- cumsum(rnorm(n)) y <- 0.5 * x + rnorm(n, sd = 0.5) # Run the test (reduced reps for speed) result <- mvardlurt(y, x, case = 3, reps = 200) print(result) # With fixed lags result2 <- mvardlurt(y, x, fixlag = c(2, 2), reps = 200)
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, reps = 100) # 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, reps = 100) # 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 pi, delta,
and 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, reps = 100) # 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, reps = 100) # Print method print(result) # Summary method summary(result) # Extract coefficients coef(result) # Extract residuals head(residuals(result)) # Extract fitted values head(fitted(result))