diagnostics | R Documentation |
diagnostics
creates visual
checks of individual models convergence. Numerical
overview of individual models can be obtained by
summary(object, type = "models", diagnostics = TRUE)
,
or even more detailed information by
summary(object, type = "individual")
.
diagnostics(
fit,
parameter,
type,
show_models = NULL,
lags = 30,
title = is.null(show_models) | length(show_models) > 1,
...
)
diagnostics_autocorrelation(
fit,
parameter = NULL,
show_models = NULL,
lags = 30,
title = is.null(show_models) | length(show_models) > 1,
...
)
diagnostics_trace(
fit,
parameter = NULL,
show_models = NULL,
title = is.null(show_models) | length(show_models) > 1,
...
)
diagnostics_density(
fit,
parameter = NULL,
show_models = NULL,
title = is.null(show_models) | length(show_models) > 1,
...
)
fit |
a fitted RoBTT object |
parameter |
a parameter to be plotted. Either
|
type |
type of MCMC diagnostic to be plotted.
Options are |
show_models |
MCMC diagnostics of which models should be
plotted. Defaults to |
lags |
number of lags to be shown for
|
title |
whether the model number should be displayed in title.
Defaults to |
... |
additional arguments to be passed to
par if |
The visualization functions are based on stan_plot function and its color schemes.
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"
.
RoBTT()
, summary.RoBTT()
## Not run:
# using the example data from Darwin
data("fertilization", package = "RoBTT")
fit <- RoBTT(
x1 = fertilization$Self,
x2 = fertilization$Crossed,
prior_delta = prior("cauchy", list(0, 1/sqrt(2))),
prior_rho = prior("beta", list(3, 3)),
seed = 1,
chains = 1,
warmup = 1000,
iter = 2000,
control = set_control(adapt_delta = 0.95)
)
### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot"
# diagnostics function allows to visualize diagnostics of a fitted RoBTT object, for example,
# the trace plot for the mean parameter in each model model
diagnostics(fit, parameter = "delta", type = "chain")
# in order to show the trace plot only for the 11th model, add show_models parameter
diagnostics(fit, parameter = "delta", type = "chain", show_models = 11)
# furthermore, the autocorrelations
diagnostics(fit, parameter = "delta", type = "autocorrelation")
# and overlying densities for each plot can also be visualize
diagnostics(fit, parameter = "delta", type = "densities")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.