Skip to contents

The Ricker model is a discrete version of the generalized Lotka-Volterra model and is implemented here as proposed by Fisher and Mehta in PLoS ONE 2014.

Usage

simulateRicker(
  n_species,
  A,
  names_species = NULL,
  x0 = runif(n_species),
  carrying_capacities = runif(n_species),
  error_variance = 0.05,
  explosion_bound = 10^8,
  t_end = 1000,
  norm = FALSE,
  ...
)

Arguments

n_species

Integer: number of species

A

interaction matrix

names_species

Character: names of species. If NULL, paste0("sp", seq_len(n_species)) is used. (default: names_species = NULL)

x0

Numeric: initial abundances of simulated species. If NULL, runif(n = n_species, min = 0, max = 1) is used.

carrying_capacities

numeric carrying capacities. If NULL, runif(n = n_species, min = 0, max = 1) is used.

error_variance

Numeric: the variance of measurement error. By default it equals to 0, indicating that the result won't contain any measurement error. This value should be non-negative. (default: error_variance = 0.05)

explosion_bound

numeric value of boundary for explosion (default: explosion_bound = 10^8)

t_end

integer number of simulations to be simulated

norm

logical scalar returning normalised abundances (proportions in each generation) (default: norm = FALSE)

...

additional parameters, see utils to know more.

Value

simulateRicker returns a TreeSummarizedExperiment class object

References

Fisher & Mehta (2014). Identifying Keystone Species in the Human Gut Microbiome from Metagenomic Timeseries using Sparse Linear Regression. PLoS One 9:e102451

Examples

A <- powerlawA(10, alpha = 1.01)
tse <- simulateRicker(n_species = 10, A, t_end = 100)