Learn R Programming

ggmcmc (version 1.2)

ggs_Rhat: Dotplot of Potential Scale Reduction Factor (Rhat)

Description

Plot a dotplot of Potential Scale Reduction Factor (Rhat), proposed by Gelman and Rubin (1992). The version from the second edition of Bayesian Data Analysis (Gelman, Carlin, Stein and Rubin) is used.

Usage

ggs_Rhat(D, family = NA, scaling = 1.5, greek = FALSE)

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).

scaling

Value of the upper limit for the x-axis. By default, it is 1.5, to help contextualization of the convergence. When 0 or NA, the axis are not scaled.

greek

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

Value

A ggplot object.

Details

Notice that at least two chains are required.

References

Fern<U+00E1>ndez-i-Mar<U+00ED>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 and Rubin (2003) Bayesian Data Analysis. 2nd edition. Chapman & Hall/CRC, Boca Raton.

Gelman, A and Rubin, DB (1992) Inference from iterative simulation using multiple sequences, _Statistical Science_, *7*, 457-511.

Examples

Run this code
# NOT RUN {
data(linear)
ggs_Rhat(ggs(s))
# }

Run the code above in your browser using DataLab