posterior_heatmap {bayesianVARs} | R Documentation |
Posterior heatmaps for VAR coefficients or variance-covariance matrices
Description
Posterior heatmaps for VAR coefficients or variance-covariance matrices
Usage
posterior_heatmap(
x,
FUN,
...,
colorbar = TRUE,
xlabels = NULL,
ylabels = NULL,
add_numbers = FALSE,
zlim = NULL,
colspace = NULL,
main = "",
cex.axis = 0.75,
cex.colbar = 1,
cex.numbers = 1,
asp = NULL
)
Arguments
x |
An array of dimension |
FUN |
The summary function to be applied to margins |
... |
optional arguments to |
colorbar |
logical indicating whether to display a colorbar or not.
Default is |
xlabels |
|
ylabels |
|
add_numbers |
logical. |
zlim |
numeric vector of length two indicating the minimum and maximum values for which colors should be plotted. By default this range is determined by the maximum of the absolute values of the selected summary. |
colspace |
Optional argument. |
main |
main title for the plot. |
cex.axis |
The magnification to be used for y-axis annotation relative to the current setting of cex. |
cex.colbar |
The magnification to be used for colorbar annotation relative to the current setting of cex. |
cex.numbers |
The magnification to be used for the actual values (if
|
asp |
aspect ratio. |
Value
Returns x
invisibly.
See Also
Other plotting plot.bayesianVARs_bvar()
,
plot.bayesianVARs_fitted()
, plot.bayesianVARs_predict()
,
pairs.bayesianVARs_predict()
.
Examples
# Access a subset of the usmacro_growth dataset
data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")]
# Estimate a model
mod <- bvar(100*data, sv_keep = "all", quiet = TRUE)
# Extract posterior draws of VAR coefficients
phi_post <- coef(mod)
# Visualize posterior median of VAR coefficients
posterior_heatmap(phi_post, median)
# Extract posterior draws of variance-covariance matrices (for each point in time)
sigma_post <- vcov(mod)
# Visualize posterior interquartile-range of variance-covariance matrix of the first observation
posterior_heatmap(sigma_post[1,,,], IQR)