ggs_effective {ggmcmc}R Documentation

Dotplot of the effective number of independent draws

Description

Dotplot of the effective number of independent draws. The default version is the sample size adjusted for autocorrelation. An alternative from the third edition of Bayesian Data Analysis (Gelman, Carlin, Stern, Dunson, Vehtari and Rubin) is provided.

Usage

ggs_effective(
  D,
  family = NA,
  greek = FALSE,
  version_effective = "spectral",
  proportion = TRUE,
  plot = TRUE
)

Arguments

D

Data frame whith the simulations

family

Name of the family of parameters to plot, as given by a character vector or a regular expression. A family of parameters is considered to be any group of parameters with the same name but different numerical value between square brackets (as beta[1], beta[2], etc).

greek

Logical value indicating whether parameter labels have to be parsed to get Greek letters. Defaults to false.

version_effective

Character variable with the name of the version of the calculation to use. Defaults to "spectral", which refers to the simple version estimating the spectral density at frequency zero used in the "coda" package. An alternative version "BDA3" is provided, which refers to the third edition of Bayesian Data Analysis (Gelman, Carlin, Stern, Dunson, Vehtari and Rubin).

proportion

Logical value whether to return the proportion of effective independent draws over the total (the default) or the number.

plot

Logical value indicating whether the plot must be returned (the default) or a tidy dataframe with the effective number of samples per Parameter.

Details

Notice that at least two chains are required.

Value

A ggplot object, or a tidy data frame.

References

Fernández-i-Marín, Xavier (2016) ggmcmc: Analysis of MCMC Samples and Bayesian Inference. Journal of Statistical Software, 70(9), 1-20. doi:10.18637/jss.v070.i09

Gelman, Carlin, Stern, Dunson, Vehtari and Rubin (2014) Bayesian Data Analysis. 3rd edition. Chapman & Hall/CRC, Boca Raton.

Examples

data(linear)
ggs_effective(ggs(s))

[Package ggmcmc version 1.5.1.1 Index]