Projects

Bayesian MAR(1) model
by brice.semmens, last updated 7/8/08, sharing set to Public
This set of Matlab scripts conducts a first order MAR(1) model to estimate interactive effects, and covariate effects, on a time series of data from a community.It uses a Gibbs sampler to estimate parameters, and currently is set up with diffuse priors on all parameters for the model. It is pretty basic at this point, but it works.
Note on the Gamma distribution:
Going back and forth between Matlab/R/WinBUGS can be confusing, because of the different parameterizations of the gamma pdf. Here's the Matlab/BUGS forms and the R equivalents:
Matlab: X ~ g(a,b) E[X] = ab
R equivalent: X ~ g(shape=a,scale=b)
BUGS: X ~ g(a,b) E[X] = a/b
R equivalent: X ~ g(shape=a,rate=b) OR
X ~ g(shape=a,scale=1/b)

Estimating heritability from time series
by mdscheuerell, last updated 1/5/11, sharing set to Public
We use a multivariate statespace model and a time series of yearly migration dates for sockeye salmon to estimate the heritability coef from the classic breeder's equation.
The 2 files below are the dataset and the R script.