Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggs_density

Density plots of the chains


Description

Density plots with the parameter distribution. For multiple chains, use colours to differentiate the distributions.

Usage

ggs_density(D, family = NA, rug = FALSE, hpd = FALSE, 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).

rug

Logical indicating whether a rug must be added to the plot. It is FALSE by default, since in large chains it may use lot of resources and it is not central to the plot.

hpd

Logical indicating whether HPD intervals (using the defaults from ci()) must be added to the plot. It is FALSE by default.

greek

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

Value

A ggplot object.

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

Examples

data(linear)
ggs_density(ggs(s))

ggmcmc

Tools for Analyzing MCMC Simulations from Bayesian Inference

v1.5.1.1
GPL-2
Authors
Xavier Fernández i Marín [aut, cre] (<https://orcid.org/0000-0002-9522-8870>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.