Learn R Programming

DiscreteDLM (version 1.0.0)

plot.MCMC_DLM: Visualises Results from MCMC_DLM Fits

Description

Provides some ggplot visualisations of the posterior from MCMC_DLM objects.

Usage

# S3 method for MCMC_DLM
plot(x, type = "beta", include_intercept = FALSE, print_output = TRUE, ...)

Value

A ggplot object, except when type = 'lags', in which case it will be a list of ggplot objects. Will display the ggplot visual if print_output = TRUE.

Arguments

x

An MCMC_DLM object.

type

One of "beta", "gamma", "xi", or "lags". Partial matching is supported. See Details below.

include_intercept

Logical indicating if the intercept should be included in the graphs.

print_output

Logical indicating whether or not the ggplot objects should be printed to the screen.

...

Extra arguments; currently unused.

Author

Daniel Dempsey (daniel.dempsey0@gmail.com)

Details

The type of plot generated is determined by the type argument. The options are:

  • beta: A ridgeplot of the regression slopes,

  • gamma: A bar chart of the mean probability of inclusion,

  • xi: A kernel density estimate plot of the negative binomial stopping parameter (of course, this only works for negative binomial regression fits),

  • lags: A collection of plots (supplied in a list), each containing a line chart of the lag-response for each dynamic variable.