Learn R Programming

pez (version 1.0-0)

sim.meta: Simulate a meta-community (and its phylogeny)

Description

Simulate a meta-community (and the resulting phylogeny) based on responses to environmental gradients

sim.meta.phy.comm simulate a (sort of) meta-community

Usage

sim.meta.comm(size = 10, n.spp = 8, timesteps = 10, p.migrate = 0.05,
  env.lam = 10, abund.lam = 5, stoch.lam = 1)

sim.meta.phy.comm(size = 10, n.spp = 8, timesteps = 10, p.migrate = 0.3, env.lam = 10, abund.lam = 5, stoch.lam = 1, p.speciate = 0.05)

Arguments

size
the length and width of the meta-community in grid cells
n.spp
number of species
timesteps
number of time-steps (each discrete)
p.migrate
probability that a group of species in each grid cell will migrate to another grid cell each timestep (i.e., 10 cells occuped by a species --> 10*p.migrate chance of migration)
env.lam
$$\lambda$$ value for Poisson distribution used to distribute environmental quality; essentially the carrying capacity (for each species separately) for that cell
abund.lam
$$\lambda$$ value for Poisson distribution used to distribute initial abundances and abundance after migration
stoch.lam
$$\lambda$$ value for Poisson distribution of noise added to the next step abundance calculation. With equal chance, this is taken as either a positive or a negative number (see details if you're confused as to why this is Poisson!)
p.speciate
probabilty that, at each timestep, a species will speciate. A species can only speciate, migrate, or reproduce if it has individuals!

Value

  • List with the species abundances (as a 3D array) and the environmental quality (carrying capacities) for sim.meta.comm. For sim.meta.phy.comm, also a phylogeny of species and a lookup table from the abundance array to the phylogeny.

    List with the species abundances (as a 3D array), the environmental quality (carrying capacities), the phylogeny of species (which generates warnings when plotted, don't ask me why!), and a lookup table from the abundance array to the phylogeny.

Details

sim.meta.comm simulates species moving through a metacommunity. At each time-step each cell's next abundance for each species is env.quality - current.abundance + stochastic, and a species gets as many chances to migrate in each time-step as it has cells (the same cell could migrate multiple times). I use a Poisson for everything because I don't want half-species (these are individuals), and keeping everything in Poisson makes it easier to compare the relative rates of everything.

sim.meta.phy.comm As above, but with a simulation of phylogeny as well - there are no additional extinction parameters, since extinction happens as a natural consequence of ecological interactions.

See Also

sim.phy scape