Provides an interface to the MCMC module
in the bayesplot package, and allows seamless plotting of
MCMC draws along with various diagnostics. This method relies heavily
on the code base for the plot.stanreg
method
in rstanarm.
# S3 method for epimodel plot( x, plotfun = "intervals", pars = NULL, regex_pars = NULL, par_models = NULL, par_types = c("fixed", "aux", "seeds"), par_groups = NULL, ... )
x | A fitted model object returned by |
---|---|
plotfun | Same as in |
pars | A character vector giving parameter names. |
regex_pars | A character vector of regular expressions to select parameters. If pars is also used, regex_pars is used in conjunction with pars. |
par_models | A character vector that restricts parameters to a subset of
model components. For example, "R" only uses parameters in the transmission model,
"inf" uses parameters in infection model. Strings giving the name of the
response in an observation model (i.e. LHS of the |
par_types | A character vector that restricts parameters based on their type. The vector can include any of "fixed", "autocor", "random", "aux", "latent", or "seeds". The default is c("fixed", "aux", "seeds"), to avoid printing a very large number of parameters. If NULL, all types are used. |
par_groups | A character vector restricting parameters to those used for a subset of regions in which the epidemic is modeled. Defaults to NULL in which case all regions are used. |
... | Arguments passed on to the bayesplot function specified by
|
Either a ggplot object that can be further customized using the
ggplot2 package, or an object created from multiple ggplot objects
(e.g. a gtable object created by arrangeGrob
).
bayesplot vignettes for examples.
MCMC-overview
(bayesplot) for plotting
function documentation.
color_scheme_set
(bayesplot) to set
plotting color scheme.