localLotkaVolterra {ibm} | R Documentation |
Lotka-Volterra with local predation interactions
Description
This function simulates several trajectories for a Lotka-Volterra model with local predation interactions as decribed in Brigatti et al. (2009).
Usage
localLotkaVolterra(
par,
T,
replicates = 1,
dim = 1,
periodic = TRUE,
spatial = FALSE,
verbose = FALSE,
maxpop = 1e+06,
fill = NA,
probs = seq(0, 1, 0.01)
)
Arguments
par |
A list containing the parameters to run the model, currently the growth rate of prey (r), the mortality rate of predator (l), predation interaction parameters (alpha and beta), diffusion rates (D), diameters of local interaction (L) and initial population size (initial). For D, L and initial population, a list with two values (named N and P) is required. |
T |
Time horizon, number of time steps to be simulated. |
replicates |
Number of replicates (trajectories) to be simulated. |
dim |
Spatial dimension for the space. Can be 1, 2 or 3. |
periodic |
Spatial boundary conditions. If |
spatial |
Boolean, should spatial outputs (position of individuals) to be saved? |
verbose |
Boolean, to print population sizes by step? |
maxpop |
Maximum population size. If predator or prey population size |
fill |
Value to initially fill the population arrays. Default to NA, 0 is an option too. |
probs |
Vector of probabilities to compute quantiles of the predator-prey interactions. get bigger, the simulation ends. |
Value
A list with the following elements:
N |
A matrix with prey population sizes by time (rows) and replicates (columns) |
P |
A matrix with predator population sizes by time (rows) and replicates (columns) |
pop |
Prey and predator positions by time, if |
Author(s)
Ricardo Oliveros–Ramos
References
Brigatti et al. 2009.
Examples
## Not run:
set.seed(880820)
par = list(alpha=5e-4, gamma=0.5, r=0.1, m=0.05, D=list(N=8e-5, P=8e-5),
L=list(N=0.2, P=0.2))
N0 = with(par, m/(2*gamma*alpha*L$P))
P0 = with(par, r/(2*alpha*L$N))
par$initial = list(N=round(N0), P=round(P0))
sim = localLotkaVolterra(par, T=240, replicates=100, maxpop = 1e4)
plot(sim)
## End(Not run)