Musings on modular MCMC code for R
I'm very interested in creating modular R code for sampling parameters in Bayesian models via various sampling schemes, such as hybrid MC, slice sampling, etc. The idea is that users could easily try sampling individual parameters or groups of parameters with various sampling schemes without having to program the sampling scheme anew. One would build a model by specifying the parameter objects for the model and calling the sampling functions desired. In addition to easing implementation of Bayesian models, it would move us towards reproducible research in that researchers could report which sampling scheme they used for each parameter, which would allow other researchers to use the same implementation. Jouni Kerman and Andrew Gelman at Columbia are implementing R code (a package called umacs) along these lines for Gibbs and Metropolis sampling within a framework of random variable objects. This framework should allow others to add their own sampling modules, and I hope to try to do this, perhaps for slice sampling.Code for spatio-temporal modeling of PM (R)
This code fits the simple, yet effective, spatio-temporal models for predicting monthly PM10 and PM2.5 in the northeastern U.S., discussed in our paper in the Annals of Applied Statistics. The code fits a spatio-temporal model, with smooth covariate terms, in two stages, a first stage for monthly-varying terms and a second stage for time-invariant terms. Each stage contains both covariates and a spatial term (one spatial term for each month in the first-stage model. The code works directly (and hopefully seemlessly) with these data, used in our paper. August 2008.Spectral Gaussian process (spectralGP) library (R)
The spectralGP library is available on CRAN. The code allows one to specify a Gaussian process as a linear combination of spectral basis functions. One can quickly simulate 1- and 2-d Gaussian processes as well as use the code in a Bayesian MCMC fitting procedure. See my associated article, published in Journal of Statistical Software, on using this library in the context of Bayesian modeling of spatial processes. This work builds on Chris Wikle's initial work on the spectral basis.MCMC code for fitting Gaussian processes using the Fourier basis (R)
This template code allows one to fit models using the Fourier basis representation of Gaussian processes with various parameterizations and sampling schemes, following the development in my article, published in Journal of Statistical Software.Spatial binary regression code (R)
I have code for fitting logistic regression models with a smooth spatial surface as part of the linear predictor. Also, I have a rough template for a MRF model based on the approach (and code) of H. Rue. This code accompanies my paper on fitting spatial models for binary outcomes. The methods included in the code file are a simple implementation of the gam() function in Simon Wood's mgcv library, a simple implementation of the PQL approach with geoadditive model style basis functions using Matt Wand's spm library, a Bayesian implementation of generalized geoadditive models and a Bayesian implementation of the spectral (Fourier) basis approach.False Discovery Rate code (R/Splus and Matlab/octave)
For an overview, see the README file.This zip file contains R code (it also works in Splus) and help files for applying the False Discovery Rate (FDR) methodology to determining significance using multiple p-values. A text file with just the code is also available. To use the code, source the file ('source fdr.R') and then use the function called 'fdr'.
For a Matlab version, download this .m file. This code also works in octave, an open source version of the Matlab language, but you need all 5 functions in their own individual .m files, so after downloading the file, manually create individual function files from the fdr.m file.
Additional details are available in our article, in Journal of Climate.
Thesis code (C++)
I do have C++ code for fitting the models in my dissertation, though this is not user-friendly and not designed for public use. I plan on creating an R version of this code.
Last updated: August 2008.