Skip to contents

Neutral species abundances simulation according to the Hubbell model.

Usage

simulateHubbell(
  n_species,
  M,
  carrying_capacity = 1000,
  k_events = 10,
  migration_p = 0.02,
  t_skip = 0,
  t_end,
  norm = FALSE
)

Arguments

n_species

integer amount of different species initially in the local community

M

integer amount of different species in the metacommunity, including those of the local community

carrying_capacity

integer value of fixed amount of individuals in the local community (default: carrying_capacity = 1000)

k_events

integer value of fixed amount of deaths of local community individuals in each generation (default: k_events = 10)

migration_p

numeric immigration rate: the probability that a death in the local community is replaced by a migrant of the metacommunity rather than by the birth of a local community member (default: migration_p = 0.02)

t_skip

integer number of generations that should not be included in the outputted species abundance matrix. (default: t_skip = 0)

t_end

integer number of simulations to be simulated

norm

logical scalar choosing whether the time series should be returned with the abundances as proportions (norm = TRUE) or the raw counts (default: norm = FALSE)

Value

simulateHubbell returns a TreeSummarizedExperiment class object

References

Rosindell, James et al. "The unified neutral theory of biodiversity and biogeography at age ten." Trends in ecology & evolution vol. 26,7 (2011).

Examples

tse <- simulateHubbell(
    n_species = 8, M = 10, carrying_capacity = 1000, k_events = 50,
    migration_p = 0.02, t_end = 100
)