ggmcmc – diagnostic plots for MCMC with ggplot2

October 21, 2012

(This article was first published on JAGS News » R, and kindly contributed to R-bloggers)

Xavier Fernández i Marín, who maintains the jags package on Gentoo Linux, writes to tell me he is developing the R package ggmcmc. This package is for visualizing Markov Chain Monte Carlo output using ggplot2 graphics and  should complement the existing plots for base and lattice graphics provided by coda. A comparison of all three graphical styles is given below.If you want to know more,  see the  tutorial by Xavier.

Trace plot from the ggmcmc package

xyplot using lattice graphics from coda

Standard coda trace plot

The samples are from the Classic BUGS example “Oxford”, after forcing  JAGS 3.3.0 to use the IWLS sampler in the glm module. As you can see, IWLS has an extremely low acceptance rate in this example, but if you run it long enough then you will see that it does generate valid samples from the posterior.

To leave a comment for the author, please follow the link and comment on their blog: JAGS News » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)