soi: Self-Organised Instability Model Community Simulation

Description Usage Arguments Value Examples

View source: R/soi.R

Description

Generate time-series with the self-organised instability (SOI) model. Implements a K-leap method for accelerating stochastic simulation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
soi(
  N,
  I,
  A,
  migr_rates = runif(N, min = 0.1, max = 0.8),
  death_rates = runif(N, min = 0.01, max = 0.08),
  com = NULL,
  tend,
  k = 5,
  norm = FALSE
)

Arguments

N

number of species

I

community size, number of available sites (individuals)

A

interaction matrix of dimension NxN

migr_rates

species-specific immigration probabilities (also determine initial abundances)

death_rates

species-specific extinction probabilities

com

Initial community abundances vector. If NULL (default), based on migration rates.

tend

number of timepoints to be returned in the time series (nr of generations)

k

the number of transition events that are allowed to take place during one leap. By default set to 5. Higher values reduce runtime, but also accuracy of the simulation.

norm

logical to indicate whether the time series should be returned with the abundances as proportions (norm = TRUE) or the raw counts (norm = FALSE, default)

Value

matrix with species abundances as rows and time points as columns

Examples

1
soi(N = 10, I = 1000, A = powerlawA(n = 10, alpha = 1.2), tend = 150, norm = TRUE)

gheysenemma/microsimR documentation built on Dec. 20, 2021, 10:46 a.m.