This functions returns a data frame containing mean, standard deviations, standard errors, and effective sample size estimates for parameters and states.
# S3 method for mcmc_output
summary(
object,
return_se = FALSE,
variable = "theta",
probs = c(0.025, 0.975),
times,
states,
use_times = TRUE,
method = "sokal",
...
)
If variable
is "theta"
or "states"
, a
data.frame
object. If "both"
, a list of two data frames.
Output from run_mcmc
if FALSE
(default), computation of standard
errors and effective sample sizes is omitted (as they can take considerable
time for models with large number of states and time points).
Are the summary statistics computed for either
"theta"
(default), "states"
, or "both"
?
A numeric vector defining the quantiles of interest. Default is
c(0.025, 0.975)
.
A vector of indices. For states, for what time points the
summaries should be computed? Default is all, ignored if
variable = "theta"
.
A vector of indices. For what states the summaries should be
computed?. Default is all, ignored if
variable = "theta"
.
If TRUE
(default), transforms the values of the time
variable to match the ts attribute of the input to define. If FALSE
,
time is based on the indexing starting from 1.
Method for computing integrated autocorrelation time. Default
is "sokal"
, other option is "geyer"
.
Ignored.
For IS-MCMC two types of standard errors are reported. SE-IS can be regarded as the square root of independent IS variance, whereas SE corresponds to the square root of total asymptotic variance (see Remark 3 of Vihola et al. (2020)).
Vihola, M, Helske, J, Franks, J. Importance sampling type estimators based on approximate marginal Markov chain Monte Carlo. Scand J Statist. 2020; 1-38. https://doi.org/10.1111/sjos.12492
data("negbin_model")
summary(negbin_model, return_se = TRUE, method = "geyer")
summary(negbin_model, times = c(1, 200), prob = c(0.05, 0.5, 0.95))
Run the code above in your browser using DataLab