dynardl {dynamac} | R Documentation |
Estimate and simulate ARDL model
Description
Estimate autoregressive distributed lag models and simulate interesting values (if desired)
Usage
dynardl(
formula,
data = list(),
lags = list(),
diffs = c(),
lagdiffs = list(),
levels = c(),
ec = FALSE,
trend = FALSE,
constant = TRUE,
modelout = FALSE,
noLDV = FALSE,
simulate = FALSE,
shockvar = list(),
shockval = sd(data[[shockvar]], na.rm = T),
time = 10,
qoi = "mean",
forceset = NULL,
range = 20,
burnin = 20,
sims = 1000,
sig = 95,
expectedval = FALSE,
fullsims = FALSE
)
Arguments
formula |
a symbolic description of the model to be estimated. ARDL models are estimated using linear regression |
data |
an optional data frame or list containing the the variables in the model |
lags |
a list of variables and their corresponding lags to be estimated |
diffs |
a vector of variables to be differenced. Only first differences are supported |
lagdiffs |
a list of variables to be included in lagged differences |
levels |
a vector of variables to be included in levels |
ec |
estimate model in error-correction form, (i.e., |
trend |
include a linear time trend. The default is |
constant |
include a constant. The default is |
modelout |
print the regression estimates in the console |
noLDV |
do not add a lagged dependent variable (LDV) to ARDL models when omitted in formula (special thanks to Hannes Datta). This is not recommended |
simulate |
simulate the reponse. Otherwise, just the regression model will be estimated. If |
shockvar |
the variable to be shocked in the counterfactual simulation. There is no default |
shockval |
the amount by which the |
time |
the time period in the simulation for the variable to be shocked |
qoi |
summarize the response of the dependent variable with the mean or the median. Although the default is |
forceset |
by default, in the simulations, variables in levels will be set to their means; variables in differences will be set to 0. Alternatively, users can set any variable in the model to a different value using a list in |
range |
the range of the simulation to be conducted |
burnin |
the number of time periods to disregard before recording the values. These do not include the |
sims |
the number of simulations to use in creating the quantities of interest (the response of the dependent variable). The default is 1000 |
sig |
the significance level (1 - |
expectedval |
if this is |
fullsims |
whether all of the raw simulations should be stored in the model object. These are required for some of the more advanced plotting functions, especially those that use the simulations to derive confidence intervals about the size of the period-over-period differences. The default is |
Details
Estimate an auto-regressive distributed lag model. Moreover, enable a graphical interpretation of the results (through dynardl.simulation.plot
) by simulating the response of the dependent variable to shocks in one of the regressors, and enable the Pesaran, Shin, and Smith (2001) test for cointegration for error-correction models (through pssbounds
)
Value
dynardl
should always return an estimated model. It may or may not be simulated, according to the user. But the relevant regression output, model residuals (which can be tested for autocorrelation), and simulated response (if created) are stored in a list if the model is assigned to an object
Author(s)
Soren Jordan and Andrew Q. Philips
Examples
# Using the inequality data from dynamac
ardl.model <- dynardl(concern ~ incshare10 + urate, data = ineq,
lags = list("concern" = 1, "incshare10" = 1),
diffs = c("incshare10", "urate"),
ec = TRUE, simulate = FALSE)
summary(ardl.model)
# Adding a lagged difference of the dependent variable
ardl.model.2 <- dynardl(concern ~ incshare10 + urate, data = ineq,
lags = list("concern" = 1, "incshare10" = 1),
diffs = c("incshare10", "urate"),
lagdiffs = list("concern" = 1),
ec = TRUE, simulate = FALSE)
summary(ardl.model.2)
# Does not work: levels and diffs must appear as a vector
## Not run:
ardl.model.3 <- dynardl(concern ~ incshare10 + urate, data = ineq,
lags = list("concern" = 1, "incshare10" = 1),
levels = list("urate" = 1),
diffs = list("incshare10" = 1, "urate" = 1),
lagdiffs = list("concern" = 1),
ec = TRUE, simulate = FALSE)
## End(Not run)
ardl.model.3 <- dynardl(concern ~ incshare10 + urate, data = ineq,
lags = list("concern" = 1, "incshare10" = 1),
levels = c("urate"),
diffs = c("incshare10", "urate"),
lagdiffs = list("concern" = 1),
ec = TRUE, simulate = FALSE)