dynardl.simulation.plot {dynamac}R Documentation

Create a plot of a simulated response in a dynardl model

Description

Create a plot of a simulated response in a dynardl model

Usage

dynardl.simulation.plot(
  x,
  type = "area",
  response = "levels",
  bw = FALSE,
  last.period = NULL,
  tol = (abs(x$model$ymean) * 0.01),
  start.period = 1,
  abs.errors = "none",
  ylim = NULL,
  ylab = NULL,
  xlab = NULL,
  ...
)

Arguments

x

a dynardl model with a simulation to be plotted

type

whether the plot should be an area plot (area) or a spike plot (spike)

response

whether the plot of the response should be shown in levels of the dependent variable (levels), levels from the mean of the dependent variable (levels.from.mean), period-over-period changes in the dependent variable (diffs), the absolute value of the (decreasing) change in the dependent variable in each time period due to the shock (shock.effect.decay), the sum of the period-over-period changes (cumulative.diffs), or the absolute value of the cumulative differences (where negative effects are treated as positive) (cumulative.abs.diffs). The default is levels

bw

should the colors be in black and white (for publication)? The default is FALSE

last.period

when deciding when to stop calculating the absolute value of the shocks to the dependent variable, you can specify a specific period in which to stop calculating absolute cumulative differences. Specify a tol or a last.period. If both are specified, last.period overrides tol

tol

when deciding when to stop calculating the absolute value of the shocks to the dependent variable, you can specify the minimum amount of movement required to qualify as a non-noise change over time periods (for calculating absolute cumulative differences). The default is 0.1 percent of the mean of the dependent variable. Specify a tol or a last.period. If both are specified, last.period overrides tol

start.period

which period of the simulation to begin the plot with. You can view the equilibriating behavior of the dependent variable, or you can skip forward in time (maybe to just before the shock). The default is 1 (the first period of the simulation)

abs.errors

when calculating confidence for the absolute cumulative effect, should differences accumulate in each time time period (cumulate, which could be explosive if the error in the model is large), should differences be observed at each time (within.period, which will have smaller values in equilibrium than when changing), or should only the values be plotted (none). The default is none

ylim

a user-defined y-limit to be used instead of the default (for instance, for shared axes)

ylab

a user-defined y-label to be used instead of the default

xlab

a user-defined x-label to be used instead of the default

...

other arguments to be passed to the call to plot

Details

When running dynardl, simulate must be TRUE so that there is a simulation to plot. For types cumulative.diffs and cumulative.abs.diffs, fullsims must be TRUE in the dynardl simulation

Value

a plot of the simulated dynardl model

Author(s)

Soren Jordan and Andrew Q. Philips

Examples

# Using the ineq data in dynamac
# Shocking Income Top 10
# Not run: simulations are time-intensive to estimate as an example
## Not run: 
set.seed(1)
ardl.model <- dynardl(concern ~ incshare10 + urate, data = ineq, 
       lags = list("concern" = 1, "incshare10" = 1),
       diffs = c("incshare10", "urate"), 
       lagdiffs = list("concern" = 1),
       ec = TRUE, simulate = TRUE, range = 30,
       shockvar = "incshare10", fullsims = TRUE)

# Shows absolute levels
dynardl.simulation.plot(ardl.model)	
# Shows changes from mean level
dynardl.simulation.plot(ardl.model, response = "levels.from.mean")  
# Same plot, but with spikeplot
dynardl.simulation.plot(ardl.model, type = "spike", response = "levels.from.mean")  
# Grayscale plots
dynardl.simulation.plot(ardl.model, bw = TRUE)

## End(Not run)	 

[Package dynamac version 0.1.12 Index]