Projects
-
PVA estimation code
by e2holmes, last updated 11/9/07, sharing set to Public
A series of modules for estimation of PVA parameters from time series data. Uses kalman filters, REML, and slope methods. -
Teaching code for State-space models
by e2holmes, last updated 5/31/07, sharing set to Public
This is some matlab labs for teaching basic concepts about stochastic population trajectories and estimation for those trajectories. -
Generate stochastic population processes
by e2holmes, last updated 6/13/07, sharing set to Public
These are function for generating various standard types of stochastic population processes: random walks, Ornstein-Uhlenbeck, discrete Gompertz, etc. Also some random number generators needed by these are here. These matlab files need the Matlat Statistics Toolbox. -
Plotting routines
Miscellaneous matlab plotting functions that come in handy. -
Searchers and samplers
This is a collection of routines for numerical sampling and searching of multivariate surfaces. It contains things like gibbs samplers, metropolis algorithms, mcmc and simulated annealing algorithms. -
LAMBDA
by e2holmes, last updated 9/11/07, sharing set to Public
LAMBDA is a MatLab toolkit designed to do MAR-1 based data analysis on long-term datasets and is based on the methods described in Ives et al. 2003, Ecological Monographs 73:301-330. LAMBDA is designed to allow the user to step through the entire modeling process, from importing the data, to obtaining descriptive statistics of the dataset, to, finally, performing a MAR-1 regression model and obtaining output parameters. A MAR-1 process is a Multivariate, Auto-Regressive first (1st) order process. Essentially, it is a means of estimating interactions between multiple variates from time series data, using matrix algebra. A MAR-1 model is a stochastic, non-mechanistic model that uses time series data on species numbers and co-variates to deduce inter-population interactions and the effects of covariates (e.g., physical variables) on populations. Where does it come from?LAMBDA is a product of the Mathematical Biology program at the Northwest Fisheries Science Center in Seattle, WA, and was developed with support by NOAA/NMFS and the National Research Council. It is open-source software released under the GNU GPL license, meaning you are free to use and modify it in (almost) any way you see fit. LAMBDA was developed by Steven Viscido while on a National Research Council postdoctoral associateship with Elizabeth Holmes.
CreditsLAMBDA is based on the techniques outlined in the paper Ives et al. 2003, Ecological Monographs 73:301-330. The code for the actual MAR-1 regression was based on the "MARbasic.m" MatLab script written by Tony Ives (available at the Ecological Archives). The parameter search code was based on an unpublished script written by Tony Ives. All other code was written by Steven Viscido.Executable versionDownload the LAMBDA executable along the installation instructions from the links below.LAMBDA_MCR_pkg.exe 0.9.2 Warning: This is a 138 MB file!
The executable version of LAMBDA does not require MatLab. Its system requirements are Windows XP/2000, 256 MB of RAM, and 150 MB of Hard Drive Space.
If Installation hangsThis is a bug on MatLab's side. To work around it, you will need to install vcredist_x86.exe (32 bit systems) or vcredist_x64.exe (64 bit system) first and then repeat the LAMBDA installation. But read the If_Installation_Hangs.txt readme file if this happens to you. This bug affects about 20% of computers, randomly it would seem.Matlab Source CodeThis is not needed if you are using the executable version. Current source code version is LAMBDA_0.9.2Beta.zip. The source code can be downloaded below. Requirements for running LAMBDA from the source code are- MatLab version 7.0.1 (R14) w/service Pack 1, or later
- MatLab's Statistics and Optimization toolboxes
- At least 256 MB of RAM on your system
- 5 MB of Hard Drive space for the LAMBDA installation
-
DARTER (Diffusion Approximation Tools for Extinction Risk Estimation)
by brice.semmens, last updated 8/23/07, sharing set to Public
This program allows one to walk through the steps required to conduct a population viability analysis, or PVA, using a population time time series. The model outputs probabilities of extinction as a function of time steps into the future, and importantly, gives confidence intervals for these probabilities.This tool has two major advantages over traditional PVA techniques:
1) It uses a state-space Kalman filter that allows for both process and non-process error.
So what's the big deal? --Functionally it filters the data, and allows a more accurate fit for population parameters of interest.2) It uses a Bayesian sampling-importance-resampling algorithm to fully address uncertainty in the parameter estimates given the data.Rather than developing a single function that describes the probability of population extinction through time, we can use the uncertainty in parameter estimates to develop 'probabilities of probabilities', or, the uncertainty surrounding the probability of extinction through time.
-
Data Cloning I: univariate
by eric.ward, last updated 5/26/08, sharing set to Public
This script writes and runs the data cloning procedure described by Lele et al. (2007, Ecology Letters). The routine is in R, and requires the user to install OpenBUGS before running. The number of clones can (and should) be modified. For this simple example, 100 clones takes ~ 2 minutes on my 2.5 year old laptop (1.66Ghz, 1GB RAM). More details and diagnostics can be found in the multivariate cloning project. -
Gibbs sampler for multiple linear regression
THE FOLLOWING FUNCTION CONDUCTS MULTIPLE LINEAR REGRESSION PARAMETER ESTIMATION VIA MCMC USING GIBBS SAMPLING. The point of this code is to show how to do it with a conjugate distribution such that the method can easily be plugged into LAMBDA. The function assumes that: 1)the B coefficients are normally distributed ~N(prior_mean,prior_s2)and thus have a normal distribution prior. Large prior variances produce suitably "diffuse" priors 2) the model variance is gamma distributed Ga(alpha, beta), with an associated prior. Small values of alpha and beta (<.001) produce a suitably "diffuse" prior. Note that Matlab's parameterization of their gamma function is a bit wonky compared to the standard. Basically, Matlab uses Ga(alpha,1/beta)-- ie. inverse of the standard scale parameter. The R code contains 2 versions of Bayesian linear regression. The first (univariate.all) uses the multivariate normal distribution to sample regression coefficients; the second (univariate.vat) does variable at a time sampling. Both R versions are nearly identical, allow a flexible range of priors for B, and allow the prior variance to be specified either as the shape-scale (e.g. gamma, scaled inv chi sq) or in terms of the mean-variance. Output includes saved parameter draws, which can be fed into CODA, and the calculation of the log(Bayes Factor) to be used for model selection. -
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)
-
KalmanEM-3.0
by e2holmes, last updated 13 hours, 6 minutes ago, sharing set to PublicTo do list
BUG TRACKING- stage 2 validation ... after package done (Eric & Eli)
- 2nd edit help files [Eli]
- chk R and Q estimation re the symmetry issue [Eli]