plot-mfbvar: Plotting methods for posterior mfbvar objects

Description Usage Arguments Value Examples

Description

Methods for plotting posterior mfbvar objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## S3 method for class 'mfbvar_ss'
plot(
  x,
  aggregate_fcst = TRUE,
  plot_start = NULL,
  pred_bands = 0.8,
  nrow_facet = NULL,
  ss_bands = 0.95,
  ...
)

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

## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

mfbvar documentation built on Feb. 10, 2021, 5:12 p.m.