Projects for Time series analysis: 
15 of
5
shown (2 visible only to FishBox members, 2 visible only to project members).



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.

LAMBDA
by e2holmes, last updated 9/11/07, sharing set to public
LAMBDA is a MatLab toolkit designed to do MAR1 based data analysis on longterm datasets and is based on the methods described in Ives et al. 2003, Ecological Monographs 73:301330. 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 MAR1 regression model and obtaining output parameters. A MAR1 process is a Multivariate, AutoRegressive first (1st) order process. Essentially, it is a means of estimating interactions between multiple variates from time series data, using matrix algebra. A MAR1 model is a stochastic, nonmechanistic model that uses time series data on species numbers and covariates to deduce interpopulation 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 opensource 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.Credits
LAMBDA is based on the techniques outlined in the paper Ives et al. 2003, Ecological Monographs 73:301330. The code for the actual MAR1 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 version
Download 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 hangs
This 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 Code
This 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

MARSS Dev Site
by e2holmes, last updated 8/30/12, sharing set to public
This is the DEVELOPMENT site for the MARSS. For the current MARSS release go to CRAN or download straight from the R GUI using "Install Packages" menu.
MARSS fits mulitvariate autoregressive statespace (MARSS) models with Gaussian errors to multivariate time series data. A MARSS model is:
x(t) = B(t) x(t1) + u(t) + C(t)c(t) + v(t), v(t)~MVN(0,Q)
y(t) = Z(t) x(t) + a(t) + D(t)d(t) + w(t), w(t)~MVN(0,R)
Project news (Feb 26, 2013): MARSS 3.4 uploaded to CRAN. I fixed MARSSkfas to work with the new KFAS package in order to use the Koopman/Durbin filter/smoother algorithms. I also coded up a lagone covariance smoother using an augmented statespace model that you can then run through the smoother to get the lagone covariances. I added a coef() and residuals() method to improve output.
Developers: Eli Holmes, Eric Ward, Mark Scheuerell and Kellie Wills
Current known issues:
 When variance is "unconstrained", the covariances can be set to 0 in the degen.test() and this leads to not posdef matrix and error. Need to block setting to 0 when this happens, or block covariances set to zero? Currently, deal with this by setting allow.degen=FALSE when covariances are estimated.
 demean.states=TRUE is causing the EM algorithm to give drops in logLik. This is not really a bug but perhaps a property of demean.states. Removed the demean.states option in vrs 3.3.
MARSS 4.0 in progress:
 4.0 involves a substantial change in the model object structurehowever the user should not notice the difference. The change allows the developers to more easily code up new model structures.
 Progress continues on writing functions for standard output, e.g. predict function added.
 Integration with LateX begun so that output can be sent to a tex or pdf file instead of just the console.

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.
Projects for Time series analysis: 
15 of
5
shown (2 visible only to FishBox members, 2 visible only to project members).

