diagnostics creates visual checks of individual models convergence. Numerical overview of individual models can be obtained by summary(object, type = "diagnostics"), or even more detailed information by summary(object, type = "individual").

diagnostics(
  fit,
  parameter = NULL,
  type,
  plot_type = "base",
  show_models = NULL,
  lags = 30,
  title = is.null(show_models) | length(show_models) > 1,
  ...
)

diagnostics_autocorrelation(
  fit,
  parameter = NULL,
  plot_type = "base",
  show_models = NULL,
  lags = 30,
  title = is.null(show_models) | length(show_models) > 1,
  ...
)

diagnostics_trace(
  fit,
  parameter = NULL,
  plot_type = "base",
  show_models = NULL,
  title = is.null(show_models) | length(show_models) > 1,
  ...
)

diagnostics_density(
  fit,
  parameter = NULL,
  plot_type = "base",
  show_models = NULL,
  title = is.null(show_models) | length(show_models) > 1,
  ...
)

Arguments

fit

a fitted RoBSA object

parameter

a parameter to be plotted.

type

type of MCMC diagnostic to be plotted. Options are "trace" for the chains' trace plots, "autocorrelation" for autocorrelation of the chains, and "densities" for the overlaying densities of the individual chains. Can be abbreviated to first letters.

plot_type

whether to use a base plot "base" or ggplot2 "ggplot" for plotting. Defaults to "base".

show_models

MCMC diagnostics of which models should be plotted. Defaults to NULL which plots MCMC diagnostics for a specified parameter for every model that is part of the ensemble.

lags

number of lags to be shown for type = "autocorrelation". Defaults to 30.

title

whether the model number should be displayed in title. Defaults to TRUE when more than one model is selected.

...

additional arguments to be passed to the plotting functions.

Value

diagnostics returns either NULL if plot_type = "base"

or an object/list of objects (depending on the number of parameters to be plotted) of class 'ggplot2' if plot_type = "ggplot2".