Learn R Programming

shrinkTVPVAR (version 0.1.1)

density_plotter: Kernel density plots of posterior distribution for hyperparameters of time-varying coefficient matrix in a TVP-VAR model

Description

density_plotter plots empirical kernel density estimates of the posterior distribution for hyperparameters of a time-varying parameter coefficient matrix in a TVP-VAR model. beta_mean and theta_sr will most likely be of interest here.

Usage

density_plotter(
  x,
  lag = 1,
  mgp = c(1.5, 0.5, 0),
  ylim,
  xlim,
  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.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 density function.

xlim

numeric vector of length 2, determining the x-axis limits of the plot. If missing, the limits are determined by the minimum and maximum values 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.

Author

Peter Knaus peter.knaus@wu.ac.at

See Also

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

Examples

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

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

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

Run the code above in your browser using DataLab