*! version 1.0.5 01may2018

Title

dynardl -- A program to dynamically simulate autoregressive distributed lag (ARDL) models.

Syntax

dynardl
depvar
indepvars, lags(numlist) shockvar(varname) shockval(#) [options]

Required options

lags(numlist) numeric list of the number of lags to include for each variable

shockvar(varname) a single independent variable from indepvars that is to be shocked

shockval(#) amount to shock shockvar(varname) by

Additional options

diffs(numlist) numeric list of the number of contemporaneous first differences to include for each variable

lagdiffs(numlist) numeric list of the number of lagged first differences to include for each variable

levels(numlist) numeric list of variables to appear in levels

ec if specified, depvar will be estimated in first differences

trend add a deterministic linear trend

noconstant suppress the constant

range(#) length of scenario to simulate (default is 20)

sig(#) significance level for confidence intervals (default is 95%)

time(#) scenario time in which the shock occurs (default is 10)

saving(string) specifies the name of the output file (default is "dynardl_results.dta")

forceset(numlist) forces the variables to be set to a user-specified value

sims(numlist) number of simulations (default is 1000)

burnin(#) allows program to iterate for stable starting values (rarely used)

graph plot dynamic results using a spikeplot. Additional options are rarea for an area plot, or change to plot changes from sample mean

expectedval calculate expected values instead of predicted values (the default)

Description

dynardl is a program to produce dynamic simulations of autoregressive distributed lag (ARDL) models. See Philips (2018) for a discussion of this approach, especially in regards to the error-correction ARDL representation of Pesaran, Shin, and Smith (2001). See Jordan and Philips (Forthcoming) for an in-depth discussion of this program.

Users can find and download the most up-to-date version of dynardl at:
http://andyphilips.github.io/dynamac/.

dynardl is designed to dynamically simulate the effects of a counterfactual change in one weakly exogenous regressor at a point in time, using stochastic simulation techniques. Since the ARDL procedure can produce models that are complicated to interpret, dynardl is designed to ease the burden of substantive interpretations through the creation of predicted (or expected) values of the dependent variable (along with associated confidence intervals), which can be plotted to show how a change in one variable "flows" through the model over time. dynardl takes 1000 (or however many simulations a user desires) draws of the set of parameters from a multivariate normal distribution, using the estimated parameters and the variance-covariance matrix from the linear regression. All covariates are set to certain values (typically means), which are used to create predicted Y-hat values plus stochastic uncertainty.

Options

Required Options

lags(numlist) is a numeric list of the number of lags to include for each variable, separated by a comma. The number of desired lags is listed in the order in which the variables depvar and indepvars appear. For instance, in a model with two weakly exogenous variables, we lag all variables by one period by specifying: lags(1, 1, 1). Note that the lag on depvar (the first "1") must always be specified. To estimate a model without a lag for a particular variable, simply replace the number with a “.”; for instance, to remove the lag on the first regressor: lags(1, ., 1). dynardl can handle consecutive and non-consecutive lags as well. For instance, lags(1/3, ., .) will introduce lags of y at t−1, t−2, and t−3 into the model, while lags(1 3/4, ., .) will add lags of y at t-1, t-3, and t-4.

shockvar(varname)
is the independent variable in indepvars that is to experience a counterfactual shock of size shockval(#) at time time(#).

shockval(#)
is the amount to shock shockvar(varname) by. Most commonly, a +/- one standard deviation shock is specified.

Additional Options

diffs(numlist) is a numeric list of the number of contemporaneous first differences (i.e., t − (t − 1)) to include for each variable, separated by a comma. Note that the first entry (the placeholder for the depvar) will always be empty (denoted by “.”), since the first difference of the dependent variable cannot appear on the right-hand side of the model.

lagdiffs(numlist) is a numeric list of the number of lagged first differences to include for each variable, separated by a comma. The lag syntax is the same as for lags( ). For instance, to include a lagged first difference at t−2 for depvar, a lag at t−1 for the first weakly exogenous regressor, and none for the second, specify lagdiff(2, 1, .). To include an additional lag for both the first and second lagged first differences of depvar, specify lagdiff(1/2, 1, .).

levels(varlist) is a numeric list of variables to appear in levels (i.e., not lagged or differenced but appearing contemporaneously at time t), separated by a comma. For instance, to include the first regressor contemporaneously in levels, specify levels(., 1, .)

ec if specified, depvar will be estimated in first differences. If estimating an error correction model, users will need to use this option.

trend if specified, the program will estimate the regression model with a deterministic linear trend.

noconstant if specified, the constant will be suppressed.

range(#) is the length of scenario to simulate. By default, this is t=20. range( ) must always be larger than time( ).

sig(#) specifies the significance level for the percentile confidence intervals. The default is for 95% confidence intervals.

time(#) is the scenario time in which the shock occurs to shockvar( ). The default time is t=10.

saving(string) specifies the name of the output file. If no filename is specified, the program will save the results as "dynardl_results.dta".

forceset(numlist) by default, dynardl estimates the ARDL model in equilibrium; all lagged variables and variables appearing in levels are set to their sample means, and all first-differences and any lagged first differences are set to zero. This option allows the user to change the setting of the lagged (or unlagged if using levels( )) levels of the variables. For instance, to set the value of the first regressor to 5, specify: forceset(., 5, .)

sims(#) is the number of simulations (default is 1000). If confidence intervals are particularly noisy, it may help to increase this number. You may need to increase the matsize in Stata.

burnin(#) allows dynardl to iterate out so starting values are stable. This option is rarely used. However, if using the option forceset( ), the predicted values will not be in equilibrium at the start of the simulation, and will take some time to converge on stable values. To get around this, one can use the burnin option to specify a number of starting simulations to drop. By default, this is 20. Burnins do not change the simulation range or time; to simulate a range of 25 with a shock time at 10 and a burnin of 30, specify: burnin(30) range(25) time(10).

graph although dynardl saves the means of the predicted values and user-specified confidence intervals in saving, users can use this option to automatically plot the dynamic results using a spikeplot. Two alternative plots are possible:

By adding the option rarea, the program will automatically create an area plot. Predicted means along with 75, 90, and 95 percent confidence intervals are shown using the area plot.

By adding the option change, predicted changes (from the sample mean) are shown across time (starting with the time at which the shock occurs), similar to an impulse response function.

expectedval by default, dynardl will calculate predicted values of the dependent variable for a given number of simulations. For every simulation, the predicted value comes from a systematic component as well as a single draw from the stochastic component. With the expectedval option, the program instead calculates expected values of the dependent variable such that the average of 1000 stochastic draws now becomes the estimate of the stochastic component for each of the simulations. This effectively removes stochastic uncertainty. Predicted values are more conservative than expected values. Note that dynardl takes longer to run if calculating expected values.

Authors

Soren Jordan

Department of Political Science

Auburn University

sorenjordanpols@gmail.com

Andrew Q. Philips

Department of Political Science

University of Colorado Boulder

andrew.philips@colorado.edu

References

If you use dynardl, please cite:

Jordan, Soren and Andrew Q. Philips. Forthcoming. "Cointegration testing and dynamic simulations of autoregressive distributed lag models". Stata Journal.

and:

Philips, Andrew Q. 2018. "Have your cake and eat it too? Cointegration and dynamic inference from autoregressive distributed lag models." American Journal of Political Science: 62(1): 230-244.

Citations

Pesaran, M Hashem, Yongcheol Shin and Richard J Smith. 2001. "Bounds testing approaches to the analysis of level relationships." Journal of Applied Econometrics 16(3):289-326.

Examples

Open up the Lutkepohl data:

set matsize 5000

webuse lutkepohl2

tsset

A −1 shock to ln_inc for the estimated equation: d.ln_inv = l.ln_inv + d.ln_inc + l.ln_inc + d.ln_consump + l.ln_consump

dynardl ln_inv ln_inc ln_consump, ///

lags(1, 1, 1) diffs(., 1, 1) ///

shockvar(ln_inc) shockval(-1) ///

time(10) range(30) graph ec

The same shock for the following equation, with an area plot: d.ln_inv = l.ln_inv + ld.ln_inv + l3d.ln_inv + l.ln_inc + l2.ln_inc + l3.ln_inc + d.ln_consump + l.ln_consump

dynardl ln_inv ln_inc ln_consump, ///

lags(1, 1/3, 1) diffs(., ., 1) lagdiffs(1 3, ., .) ///

shockvar(ln_inc) shockval(-1) ///

time(10) range(30) graph ec rarea sims(5000)

The same shock for the following equation, graphed as an impulse response function, with ln_inc and ln_consump set to 6 and 7, respectively: ln_inv = l.ln_inv + ln_inc + l.ln_inc + ln_consump + l.ln_consump

dynardl ln_inv ln_inc ln_consump, ///

lags(1, 1, 1) levels(., 1, 1) forceset(., 6, 7) ///

shockvar(ln_inc) shockval(-1) ///

time(10) range(30) graph change sims(5000)

See Jordan and Philips (Forthcoming) for more examples and an in-depth discussion.

Version

version 1.0.5, Apr 18, 2018.