glv: Simulate time series with the generalized Lotka-Volterra...

Description Usage Arguments Value Note See Also Examples

View source: R/glv.R

Description

Simulate a community time series using the generalized Lotka-Volterra model, defined as dx/dt = x(b+Ax), where x is the vector of species abundances, A is the interaction matrix and growth_rates the vector of growth rates.

Usage

1
glv(N, A, b = runif(N), x = runif(N), tend = 1000, norm = FALSE)

Arguments

N

species number

A

interaction matrix

b

growth rates

x

initial abundances

tend

timepoints

norm

return normalised abundances (proportions in each generation)

Value

a matrix with species abundances as rows and time points as columns, column names give time points

Note

Calls upon the lsoda function from package deSolve to solve the ODE. If function crashes, consider running again with while loop and tryCatch handlings.

See Also

deSolve::lsoda

Examples

1
glv(N = 4, A = powerlawA(n = 4, alpha = 2), tend = 1000)

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