Learn R Programming

mfbvar (version 0.5.6)

plot-mfbvar: Plotting methods for posterior mfbvar objects

Description

Methods for plotting posterior mfbvar objects.

Usage

# S3 method for mfbvar_ss
plot(
  x,
  aggregate_fcst = TRUE,
  plot_start = NULL,
  pred_bands = 0.8,
  nrow_facet = NULL,
  ss_bands = 0.95,
  ...
)

# S3 method for mfbvar_ssng plot( x, aggregate_fcst = TRUE, plot_start = NULL, pred_bands = 0.8, nrow_facet = NULL, ss_bands = 0.95, ... )

# S3 method for mfbvar_minn plot( x, aggregate_fcst = TRUE, plot_start = NULL, pred_bands = 0.8, nrow_facet = NULL, ... )

varplot(x, variables = colnames(x$Y), var_bands = 0.95, nrow_facet = NULL, ...)

Arguments

x

object of class mfbvar_minn or mfbvar_ss

aggregate_fcst

Boolean indicating whether forecasts of the latent monthly series should be aggregated to the quarterly frequency.

plot_start

Time period (date or number) to start plotting from. Default is to to use 5*n_fcst time periods if n_fcst exists, otherwise the entire sample.

pred_bands

Single number (between 0.0 and 1.0) giving the coverage level of forecast intervals.

nrow_facet

an integer giving the number of rows to use in the facet

ss_bands

(Steady-state prior only) Single number (between 0.0 and 1.0) giving the coverage level of posterior steady-state intervals.

...

Currently not in use.

variables

Vector of names or positions of variables to include in the plot of variances

var_bands

(varplot only) Single number (between 0.0 and 1.0) giving the coverage level of posterior intervals for the error standard deviations.

Value

A ggplot.

Examples

Run this code
# NOT RUN {
prior_obj <- set_prior(Y = mf_usa, d = "intercept",
                       n_lags = 4, n_reps = 20,
                       n_fcst = 4, n_fac = 1)

prior_intervals <- matrix(c(1, 3,
                            4, 8,
                            1, 3), ncol = 2, byrow = TRUE)
psi_moments <- interval_to_moments(prior_intervals)
prior_psi_mean <- psi_moments$prior_psi_mean
prior_psi_Omega <- psi_moments$prior_psi_Omega
prior_obj <- update_prior(prior_obj,
                          prior_psi_mean = prior_psi_mean,
                          prior_psi_Omega = prior_psi_Omega)

mod_ss <- estimate_mfbvar(prior_obj, prior = "ss", variance = "fsv")
plot(mod_ss)
varplot(mod_ss)
# }

Run the code above in your browser using DataLab