
Last chance! 50% off unlimited learning
Sale ends in
Deprecated. Use plot.bvar
instead.
Diagnostic plots of the trace / density of a single hyperparameter.
A parameter may be plotted across multiple iterations of bvar
via the ellipsis parameter. Given that the settings for bvar
are identical this can be used to assess convergence.
bv_plot_trace(x, name, ...)bv_plot_density(x, name, ...)
A bvar
object, obtained from bvar
.
String with the name of the hyperparameter to plot. Possible
values are names of hyperparameters and "ml"
for the posterior
marginal likelihood.
Further bvar
objects to include in the plot. The desired
hyperparameter must be available and priors of the objects should match.
# NOT RUN {
data <- matrix(rnorm(200), ncol = 2)
x <- bvar(data, lags = 2)
# Plot the trace of lambda
bv_plot_trace(x, "lambda")
# Adjust par() and plot the density of the posterior marginal likelihood
op <- par(mar = c(2, 2, 2, 0.5))
bv_plot_density(x, "ml")
par(op)
# Assess parameter convergence of several chains via their trace
y <- bvar(data, lags = 2)
z <- bvar(data, lags = 2)
bv_plot_trace(x, "lambda", y, z)
# }
Run the code above in your browser using DataLab