This archive contains Matlab functions and scripts for fitting semi-parametric models to multiple short time series of cover of three reef components: hard corals, macroalgae, and everything else ('others'). The details are described in Zychaluk et al (unpublished), Modelling regional coral reef dynamics without mechanistic assumptions.

REQUIREMENTS

Matlab, with the Curve Fitting, Optimization and Statistics Toolboxes.

Tested with Matlab Version 7.9.0.529 (R2009b), Curve Fitting Toolbox Version 2.1, Optimization Toolbox Version 4.3, Statistics Toolbox Version 7.2, operating system Linux 2.6.26-2-686.

EXAMPLE

Run example_script.m to do the following:

-generate and plot a simulated data set, and summarize it in terms of perturbations. This simulation is based on the initial values and time series lengths for a real data set (loaded from startvals.txt), but is generated using a stochastic version of the differential equation model described in Mumby et al (2007), Nature 450:98-101. The model has both process and measurement error.

-estimate the equilibrium distribution for these data, using semi-parametric methods, and calculate summary statistics: note that a single measure of centre isn't very appropriate for a bimodal distribution.

-produce diagnostic plots of residuals.

-calculate the damping ratio

-plot differences between current and equilibrium distributions (over a small number of time steps)

-plot the estimated alpha parameters of the local Dirichlet distributions

Expect this to take about 85 minutes on a 3GHz quad-core Xeon with 4G RAM. You can skip sections by setting elements of the skip vector to 1 instead of 0. There are dependencies between sections, for example, none of the later sections will run unless a simulated data set, created in the first section, exists.

The results are saved to the Matlab file simdata.mat. This will be overwritten on each run.

Code for running multiple replicates and jackknifing is not included, because this was run on a Condor system for which the setup is location-specific. This code is available on request, on the understanding that it will probably need alterations to run elsewhere.

LICENSE

 This file is part of coralsimplex.

    Coralsimplex is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Coralsimplex is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with coralsimplex.  If not, see <http://www.gnu.org/licenses/>.

See gpl-3.0.txt for full information.

Makes use of the function simplexquad.m by Greg von Winckel, distributed under the BSD license, given below:

 Copyright (c) 2009, Greg von Winckel
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without 
 modification, are permitted provided that the following conditions are 
 met:
 
     * Redistributions of source code must retain the above copyright 
       notice, this list of conditions and the following disclaimer.
     * Redistributions in binary form must reproduce the above copyright 
       notice, this list of conditions and the following disclaimer in 
       the documentation and/or other materials provided with the distribution
       
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 POSSIBILITY OF SUCH DAMAGE.


