Learn R Programming

shrinkTVPVAR (version 0.1.1)

state_plotter: Graphical summary of posterior distribution for a time-varying coefficient matrix in a TVP-VAR model

Description

plot.mcmc.tvp plots empirical posterior quantiles for a time-varying parameter coefficient matrix in a TVP-VAR model.

Usage

state_plotter(
  x,
  lag = 1,
  mgp = c(1.5, 0.5, 0),
  ylim,
  ylabs,
  mains,
  h_borders = c(0.075, 0.05),
  w_borders = c(0.05, 0.05),
  ...
)

Value

Called for its side effects and returns invisibly.

Arguments

x

mcmc.tvp.var object

lag

single integer value, indicating the lag of the time-varying VAR to be plotted. The default value is 1.

mgp

vector of length 3, determining the margin line (in par) for the plot. The default value is c(1.5, 0.5, 0). See par for more information.

ylim

numeric vector of length 2, determining the y-axis limits of the plot. If missing, the limits are determined by the lowest and largest quantiles of the data.

ylabs

character vector of length m, determining the y-axis labels of the plot. If missing, the labels are taken from the column names of the data.

mains

character vector of length m, determining the main titles of the plot. If missing, the titles are taken from the column names of the data.

h_borders

numeric vector of length 2, determining the horizontal borders of the plot. The first value is the space between the plot and the left border, the second value is the space between the plot and the right border. Both are fractions of the total width of the plot. The default value is c(0.075, 0.05).

w_borders

numeric vector of length 2, determining the vertical borders of the plot. The first value is the space between the plot and the top border, the second value is the space between the plot and the bottom border. Both are fractions of the total height of the plot. The default value is c(0.05, 0.05).

...

further arguments to be passed to plot.mcmc.tvp (see shrinkTVP package).

Author

Peter Knaus peter.knaus@wu.ac.at

See Also

Other plotting functions: TV_heatmap(), density_plotter(), plot.mcmc.tvp.var(), plot.mcmc.var(), plot.shrinkTVPVAR(), plot.shrinkTVPVAR_fit(), plot.shrinkTVPVAR_forc()

Examples

Run this code
# \donttest{
set.seed(123)
sim <- simTVPVAR(p = 2)
data <- sim$data

res <- shrinkTVPVAR(data, p = 2)
plot(res$beta)

# Plot second lag
plot(res$beta, lag = 2)
# }

Run the code above in your browser using DataLab