Description Usage Arguments Details Value Note Author(s) References See Also Examples
Generates an m x m matrix of density plots for each
free parameter in an szbsvar
A(0) object produced by
gibbs.A0
, with associated highest posterior density (HPD) regions.
1 2 |
x |
An A(0) posterior object created by
|
hpd |
Probability width of the highest posterior density region, default is 0.68 or approximately one standard deviation around the mode of the parameter |
varnames |
List of variable names for labeling the equations
and variables. Default are the names of the variables for the
input data to |
... |
optional graphics arguments |
This function plots an m x m matrix of densities for
the posterior of the A(0) free parameters for a B-SVAR
model. The plot is arranged such that the unrestricted parameters for
each contemporaneous effect of each variable on an equation are in the
row for that equation. So the first row shows densities for the
contemporaneous effects of the column variables (as in an impulse
response plot like plot.irf
or plot.mc.irf
). Elements
of A(0) that were restricted to zero are left empty in the
matrix of densities. The pattern of the densities will match the
*tranpose* of the ident
matrix passed to szbsvar
.
Highest posterior density regions are plotted using Hyndman's 91996) density quantile algorithm. These HPDs are defined by a set of vertical bars over the HPD interval. The vertical line in each plot measures the value of the density at the boundaries of the HPD region. The HDR is superimposed at the bottom of each density.
None. Main purposed is to plot density summaries and HPDs for each of the free parameters in an A(0) matrix.
The plot will tend to be large, so be sure to adjust the size of your plotting device accordingly so things are visible.
Patrick T. Brandt
Hyndman, Rob J. 1996. "Computing and Graphic Highest Density Regions", The American Statistician, 50(2):120–126
HPD code is borrowed from Hyndman's hdrcde package, version 2.07.
plot.mcmc
,
summary.mcmc
, and A02mcmc
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # SZ, B-SVAR model for the Levant data
data(BCFdata)
m <- ncol(Y)
ident <- diag(m)
ident[1,] <- 1
ident[2,1] <- 1
# estimate the model's posterior moments
set.seed(123)
model <- szbsvar(Y, p=2, z=z2, lambda0=0.8, lambda1=0.1, lambda3=1, lambda4=0.1,
lambda5=0.05, mu5=0, mu6=5, ident, qm=12)
# Set length of burn-in and size of posterior. These are only an
# example. Production runs should set these much higher.
N1 <- 1000
N2 <- 10000
A0.posterior.obj <- gibbs.A0(model, N1, N2, thin=1)
# Plot the matrix of the densities
dev.new()
plot.gibbs.A0(A0.posterior.obj, hpd=0.68, varnames=colnames(Y))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.