Title: | Bootstrapping the ARDL Tests for Cointegration |
---|---|
Description: | The bootstrap ARDL tests for cointegration is the main functionality of this package. It also acts as a wrapper of the most commond ARDL testing procedures for cointegration: the bound tests of Pesaran, Shin and Smith (PSS; 2001 - <doi:10.1002/jae.616>) and the asymptotic test on the independent variables of Sam, McNown and Goh (SMG: 2019 - <doi:10.1016/j.econmod.2018.11.001>). Bootstrap and bound tests are performed under both the conditional and unconditional ARDL models. |
Authors: | Gianmarco Vacca, Stefano Bertelli |
Maintainer: | Gianmarco Vacca <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.1.0 |
Built: | 2024-11-11 07:29:00 UTC |
Source: | CRAN |
This is the main function of the package. It performs the bootstrap version of the ARDL bound test for cointegration.
boot_ardl( data, yvar = NULL, xvar = NULL, fix.ardl = NULL, info.ardl = "AIC", fix.vecm = NULL, info.vecm = "AIC", maxlag = 5, a.ardl = 0.05, a.vecm = 0.05, nboot = 2000, case = 3, a.boot.H0 = c(0.05, 0.025, 0.01), print = T )
boot_ardl( data, yvar = NULL, xvar = NULL, fix.ardl = NULL, info.ardl = "AIC", fix.vecm = NULL, info.vecm = "AIC", maxlag = 5, a.ardl = 0.05, a.vecm = 0.05, nboot = 2000, case = 3, a.boot.H0 = c(0.05, 0.025, 0.01), print = T )
data |
Input dataset. Must contain a dependent and a set of independent variables. |
yvar |
Name of the dependent variable, enclosed in quotation marks. If NULL, the first variable will be used. |
xvar |
Vector of names of the independent variables, each enclosed in quotation marks. If NULL, all variables except the first will be used. |
fix.ardl |
Fixed lagged differences for the short term part of the ARDL equation. |
info.ardl |
Selection criterion for the auto_ardl function. Options are "AIC", "AICc", BIC, "R2", "adjR2", if fix.ardl is null. Defaults to AIC. |
fix.vecm |
Fixed lagged differences for the short term part of the VECM equation. |
info.vecm |
Selection criterion for the VARselect function. Options are "AIC", "HQ", "SC", "FPE", if fix.vecm is null. Defaults to AIC. |
maxlag |
Max number of lags for the auto_ardl and VARselect procedures, if fix.ardl or fix.vecm are null, respectively. |
a.ardl |
Threshold significance for the short-term ARDL coefficients significance. |
a.vecm |
Threshold significance for the short-term VECM coefficients significance. |
nboot |
Number of bootstrap replications. |
case |
Model case, pertaining to the treatment of intercept and trend. Must be integer from 1 to 5. Defaults to 3. |
a.boot.H0 |
Probability/ies by which the critical quantiles of the bootstrap distribution(s) must be calculated. |
print |
Show the progress bar. |
List of several elements including
data
: the data used to perform estimation and testing
ARDL
: the estimated ARDL conditional model
VECM
: the estimated VECM unconditional model
jo.testX
: Johansen cointegration test on the independent variables
pssbounds
: the PSS bound test output
smgbounds
: the SMG bound test critical values
fov.stat
: the test statistics on the conditional Fov tests
t.stat
: the test statistics on the conditional t test
find.stat
: the test statistics on the conditional Find tests
quantfov
: the bootstrap conditional F Overall test critical value(s)
quantt
: the bootstrap conditional t-test critical value(s)
quantfind
: the bootstrap conditional F Independent test critical value(s)
fakecoint
: indication of the situation in which but
, signaling absence of cointegration.
## Not run: #LOAD DATA data("ger_macro") # DATA PREPARATION LNDATA = apply(ger_macro[,-1], 2, log) col_ln = paste0("LN", colnames(ger_macro)[-1]) LNDATA = as.data.frame(LNDATA) colnames(LNDATA) = col_ln LNDATA$DATE = ger_macro$DATE #ARDL BOOT BCT_res = boot_ardl(data = LNDATA, yvar = "LNCONS", xvar = c("LNINCOME","LNINVEST"), maxlag = 5, a.ardl = 0.1, a.vecm = 0.1, nboot = 2000, case = 3, a.boot.H0 = c(0.05), print = T) summary(boot_res) ## End(Not run)
## Not run: #LOAD DATA data("ger_macro") # DATA PREPARATION LNDATA = apply(ger_macro[,-1], 2, log) col_ln = paste0("LN", colnames(ger_macro)[-1]) LNDATA = as.data.frame(LNDATA) colnames(LNDATA) = col_ln LNDATA$DATE = ger_macro$DATE #ARDL BOOT BCT_res = boot_ardl(data = LNDATA, yvar = "LNCONS", xvar = c("LNINCOME","LNINVEST"), maxlag = 5, a.ardl = 0.1, a.vecm = 0.1, nboot = 2000, case = 3, a.boot.H0 = c(0.05), print = T) summary(boot_res) ## End(Not run)
The data set contains quarterly, seasonally adjusted time series for West German fixed investment, disposable income, and consumption expenditures in billions of DM from 1960Q1 to 1982Q4. It was produced from file E1 of the data sets associated with Lutkepohl (2007). Originally obtained from Deutsche Bundesbank.
ger_macro
ger_macro
A data frame with 92 rows and 4 variables:
Quarter
Fixed investment (DM Billions)
Disposable income (DM Billions)
Consumption expenditures (DM Billions)
http://www.jmulti.de/download/datasets/e1.dat
The data set contains yearly, time series for Italian log GDP, log foreign direct investment, and log exports, from 1970 to 2020. Obtained from the World Bank Database.
ita_macro
ita_macro
A data frame with 51 rows and 4 variables:
From 1970 to 2020
log Exports (Adjusted for DGP deflator)
log Foreign Direct Investment (Adjusted for DGP deflator)
log GDP
World Bank Database
This function lags a set of variables in a matrix, each with a separate index. It is also possible to retain only the last lag order.
lag_mts(X, k, last.only = F)
lag_mts(X, k, last.only = F)
X |
numeric matrix whose columns are subject to lagging |
k |
vector of lag orders |
last.only |
If TRUE only the k-th order lag will be computed, otherwise all lags from 1 to k |
a matrix whose columns are the original variables and the k-th order lagged variables. Column name suffix ".lx".
data(ger_macro) lag_mts(X = ger_macro, k = 3, last.only = FALSE)
data(ger_macro) lag_mts(X = ger_macro, k = 3, last.only = FALSE)
Generate data from a VECM/ARDL equation
sim_vecm_ardl( nobs, case = 1, sigma.in, gamma.in, axx.in, ayx.uc.in, ayy.in, mu.in = NULL, eta.in = NULL, azero.in = NULL, aone.in = NULL, burn.in = nobs * 0.5, seed.in = NULL )
sim_vecm_ardl( nobs, case = 1, sigma.in, gamma.in, axx.in, ayx.uc.in, ayy.in, mu.in = NULL, eta.in = NULL, azero.in = NULL, aone.in = NULL, burn.in = nobs * 0.5, seed.in = NULL )
nobs |
number of observations. |
case |
case related to intercept and trend |
sigma.in |
error covariance matrix |
gamma.in |
list of VECM short-run parameter matrices |
axx.in |
long-run relationships between the independent variables |
ayx.uc.in |
long-run unconditional relationship between dependent and independent variables, |
ayy.in |
long-run relationship for the dependent variable |
mu.in |
VAR intercept vector |
eta.in |
VAR trend vector |
azero.in |
VECM intercept |
aone.in |
VECM trend |
burn.in |
burn-in number of observations |
seed.in |
optional seed number for random error generation. |
A list that includes
dims
: a vector with the dataset dimension
case
: the case given as input
data
: the generated data
diffdata
: the data first difference
ut
: the generated random error matrix.
sigma
: the error covariance matrix .
omega
: the vector of parameters generated via conditioning
at
: the conditional long-run parameter matrix
ayy
: the coefficient weighting the EC term,
ayx.uc
: the unconditional subvector of the ARDL equation
ayx2
: the conditioning effect
ayx.c
: the conditional subvector of the ARDL equation
gammalist
: the list of unconditional parameter matrices
psilist
: the list of conditional parameter matrices
vmu
: the VAR intercept
veta
: the VAR trend
azero
: the unconditional VECM intercept
aone
: the unconditional VECM trend
azero.c
: the conditional VECM intercept
aone.c
: the conditional VECM trend
interc.ardl
: the conditional ARDL intercept (case > 2)
trend.ardl
: the conditional ARDL trend (case = 5)
theta0
: the coefficient in the EC term (case = 2)
theta1
: the coefficient in the EC term (case = 4)
interc.ec
: the conditional ARDL intercept derived from the EC tem (case = 2)
trend.ec
: the conditional ARDL trend derived from the EC tem (case = 4)
#PARAMETERS #Sigma corrm = matrix(0, ncol = 3, nrow = 3) corrm[2,1] = 0.25 corrm[3,1] = 0.4 corrm[3,2] = -0.25 corrs = (corrm + t(corrm)) + diag(3) sds = diag(c(1.3, 1.2, 1)) sigma = (sds %*% corrs %*% t(sds)) #Gamma gammax = list() gammax[[1]] = matrix(c(0.6, 0, 0.2, 0.1, -0.3, 0, 0, -0.3, 0.2), nrow = 3, ncol = 3, byrow = TRUE) gammax[[2]] = matrix(c(0.2, 0, 0.1, 0.05, -0.15, 0, 0, 0, 0.1), nrow = 3, ncol = 3, byrow = TRUE) #DATA GENERATION data_sim = sim_vecm_ardl(nobs = 200, case = 3, sigma.in = sigma, gamma.in = gammax, axx.in = matrix(c(0.3, 0.5, 0.4, 0.3), nrow = 2, ncol = 2), ayx.uc.in = c(0.5,0.6), ayy.in = 0.7, mu.in = rep(0, 3), eta.in = rep(0, 3), azero.in = rep(0.4, 3), aone.in = rep(0, 3), burn.in = 50, seed.in = 10)
#PARAMETERS #Sigma corrm = matrix(0, ncol = 3, nrow = 3) corrm[2,1] = 0.25 corrm[3,1] = 0.4 corrm[3,2] = -0.25 corrs = (corrm + t(corrm)) + diag(3) sds = diag(c(1.3, 1.2, 1)) sigma = (sds %*% corrs %*% t(sds)) #Gamma gammax = list() gammax[[1]] = matrix(c(0.6, 0, 0.2, 0.1, -0.3, 0, 0, -0.3, 0.2), nrow = 3, ncol = 3, byrow = TRUE) gammax[[2]] = matrix(c(0.2, 0, 0.1, 0.05, -0.15, 0, 0, 0, 0.1), nrow = 3, ncol = 3, byrow = TRUE) #DATA GENERATION data_sim = sim_vecm_ardl(nobs = 200, case = 3, sigma.in = sigma, gamma.in = gammax, axx.in = matrix(c(0.3, 0.5, 0.4, 0.3), nrow = 2, ncol = 2), ayx.uc.in = c(0.5,0.6), ayy.in = 0.7, mu.in = rep(0, 3), eta.in = rep(0, 3), azero.in = rep(0.4, 3), aone.in = rep(0, 3), burn.in = 50, seed.in = 10)
This internal data contains critical values of the Find test of Sam et al (2018), for several sample sizes and lag orders. Applicable only for cases I, III, and V. Critical values at significance levels 1%, 2.5%, 5% and 10%.
smk_crit
smk_crit
A data frame with 144 rows and 17 variables
case related to intercept and trend specification. Only I, III or V
significance levels. 0.01, 0.025, 0.05 or 0.10
sample size, 30 to 80 and beyond for asymptotic critical values
right threshold for accepting the null of zero coefficients in the Find test. x: 1 to 7
left threshold for rejecting the null of zero coefficients in the Find test. x: 1 to
This function summarizes the ARDL bootstrap test and all the other asymptotic procedures all together.
## S3 method for class 'bootCT' summary(object, ...)
## S3 method for class 'bootCT' summary(object, ...)
object |
an object of class " |
... |
additional arguments, e.g. |
the function returns a list of summary statistics, already present in the function boot_ardl
, and displays them in an appropriate manner. Depending on the out
argument, ARDL/VECM estimation outputs and/or ARDL/VECM cointegration tests can be displayed.