Code
Data sets
- Daily US precipitation data (R workspace) provided by the United States Historical Climatology Network
- Climate model output (R workspace) provided by the North American Regional Climate Change Assessment Program
- Gun laws and homicides data (R workspace and spatial coordinates) taken from Kalesan et al. (Supplement and story)
- GPS observations from Reveal Mobile (R workspace and Documentation)
Visualization
- Geostat plotting using fields
- Geostat plotting using ggplot2
- Geostat plotting using google maps
- Areal data plotting using ggplot2
Mean and covariance functions
- Fitting the mean function
- Drawing realizations from a nonstationary Gaussian process (R code)
- Drawing realizations from a Matern covariance (R code)
- A basic spatial analysis of ozone data
Representations of a Gaussian process
- Empirically orthogonal functions
- Realizations of a 1D Gaussian kernel convolution process (R code)
- Compute spectral density and plot sample paths
- Filter a map using FFT (code)
Estimation and prediction
- The empirical variogram (R code)
- MLE estimation (R code)
- Kriging derivation
- Kriging weights (R code)
- Frequentist asymptotics in a simple case
Methods for large datasets
- Timings of matrix operations
- Estimating Matern parameters using a variogram
- Evaluation of the predictive process approximation (R script)
- Parameter estimation using a spectral approximation
Nonstationarity
Spatial GLMs + Bayesian methods
- Spatial counts with random effects and a copula (R script)
- Non-spatial Gibbs sampling
- Illustration of 1D Metropolis sampling
- Metropolis sampling for non-spatial logistic regression
- Bayesian Kriging with MCMC
- Spatial GLM with MCMC (R script)
Spatiotemporal methods
- Exploratory analysis of precip data
- Spectral analysis of precip data
- Fit a separable model via MCMC
- Realizations of a non-separable process (thanks to Joe Guinness)
Multivariate methods
Areal data models
- Fit a CAR model using MCMC to simulated data for NC
- JAGS code for the CAR model
- Realizations from an autologistic/Potts model
Spatial point patterns
Spatial point patterns