Part I: Mark recapture

- lnmodels.txt my lnL functions for M0, Mt, and Mb models.
- example of using numerical optimization functions
- lnlmulti.txt Example, using multinomial model, of maximizing a likelihood with more than one parameter, estimating the hessian, numerically estimating the variance, and calculating the profile likelihood.
- lnlmulti2.txt A couple of tricks to avoid evaluating lnL for nonsense parameter values (e.g. p < 0)
- simmulti.r Functions to simulate capture history data from M0, Mt, and Mb. Also, functions to compute sufficient statistics for each model from a capture history.
- huggins.r Functions to fit Huggins models for HW 2.

Part II: Population models

- matrix.r Demonstration of matrix operations in R
- bootex.r Using the boot library to draw bootstrap samples and calculate confidence intervals. Requires bootex.txt from the datasets page.
- markov.r Function to calculate stochastic log lambda and its variance given an environmental transition matrix and set of population transition matrices

Part IV: Hierchical modeling

- normal.r Driver program for Bayesian estimation of mean and variance of a normal distribution, inv. gamma prior for variance
- normal.bug WinBUGS code for Bayesian estimation of mean and variance of a normal distribution, inv. gamma prior for variance
- normalcode.r R code used during 'hands-on' lab on Thursday
- normal2.r Driver program for Bayesian estimation of mean and variance of a normal distribution, inv. squared uniform prior for variance
- normal2.bug WinBUGS code for Bayesian estimation of mean and variance of a normal distribution, inv. gamma squared uniform prior for variance
- exp.r Driver program for Bayesian estimation of parameters of a exponential growth state space model
- exp.bug WinBUGS/OpenBUGS code for Bayesian estimation of parameters of a exponential growth state space model
- expAfter.r Examples of things you can do after you fit an OpenBUGS model

- read.r Reading and basic manipulation of a data matrix
- mds.r Fitting metric and non-metric MDS
- labelplots.r Various useful ways to draw MDS plots and control their appearance
- env.r Evaluating association with environmental variables
- hyptest.r code for permANOVA = adonis() function and various other methods that we haven't discussed
- findzeros.r Code to find sites with identical species composition (0 distance), which causes problems with most analyses
- whichsite.r Utility function to identify the two sites corresponding to a element in the distance matrix or MDS plot