Creates density plots, trace plots, and autocorrelation plots for a given parameter of a JAGS model.
JAGS_diagnostics(
fit,
parameter,
type,
plot_type = "base",
xlim = NULL,
ylim = NULL,
lags = 30,
n_points = 1000,
transformations = NULL,
transform_factors = FALSE,
transform_orthonormal = FALSE,
short_name = FALSE,
parameter_names = FALSE,
formula_prefix = TRUE,
...
)
JAGS_diagnostics_density(
fit,
parameter,
plot_type = "base",
xlim = NULL,
n_points = 1000,
transformations = NULL,
transform_factors = FALSE,
transform_orthonormal = FALSE,
short_name = FALSE,
parameter_names = FALSE,
formula_prefix = TRUE,
...
)
JAGS_diagnostics_trace(
fit,
parameter,
plot_type = "base",
ylim = NULL,
transformations = NULL,
transform_factors = FALSE,
transform_orthonormal = FALSE,
short_name = FALSE,
parameter_names = FALSE,
formula_prefix = TRUE,
...
)
JAGS_diagnostics_autocorrelation(
fit,
parameter,
plot_type = "base",
lags = 30,
transformations = NULL,
transform_factors = FALSE,
transform_orthonormal = FALSE,
short_name = FALSE,
parameter_names = FALSE,
formula_prefix = TRUE,
...
)
a JAGS model fitted via JAGS_fit()
parameter to be plotted
what type of model diagnostic should be plotted. The available
options are "density"
, "trace"
, and "autocorrelation"
whether to use a base plot "base"
or ggplot2 "ggplot"
for plotting.
x plotting range
y plotting range
number of lags to be shown for the autocorrelation plot.
Defaults to 30
.
number of equally spaced points
in the x_range
if x_seq
is unspecified
named list of transformations to be applied to specific parameters
whether factors with orthonormal/meandif prior distribution should be transformed to differences from the grand mean
(to be depreciated) whether factors with orthonormal prior distributions should be transformed to differences from the grand mean
whether prior distribution names should be shorted
whether parameter names should be printed
whether the parameter prefix from formula should
be printed. Defaults to TRUE
.
additional arguments
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"
.