symdyn: Simulate time series for a single species in a single patch

View source: R/ecostatscale.R

symdynR Documentation

Simulate time series for a single species in a single patch

Description

Function for simulating dynamics from Eq.1 in the main text.

Usage

symdyn(
  r,
  f,
  d,
  d_sd,
  sf,
  tmax,
  stochd = TRUE,
  stocht = TRUE,
  as.matrix = FALSE,
  oscillate_dist = FALSE
)

Arguments

r

per-capita growth rate (r in Eq.1)

f

the waiting time (or average waiting time) between disturbance events (equal to 1/lambda in Eq.1)

d

mean size of disturbance function (mu in Eq.1)

d_sd

standard deviation of disturbance function (sigma in Eq.1)

sf

waiting time between sampling events

tmax

the time series length to be simulated

stochd

a logical variable, indicating whether disturbance size should be stochastic - otherwise, all disturbances are of magnitude d - defaults to TRUE

stocht

a logical variable, indicating whether waiting time between disturbance events should be stochastic - otherwise, waiting time is always f - defaults to TRUE

as.matrix

indicates whether results should be returned as matrix (potentially faster for some applications) - defaults to FALSE

oscillate_dist

a logical variable indicating whether the sign of the disturbance should oscillate between positive and negative - ignored if stochd==TRUE - defaults to FALSE

Value

a matrix or data.frame with columns for sampling times, abundances, and number of disturbances for each time interval

Examples

# see xt2fun

ecostatscale documentation built on Oct. 23, 2023, 1:06 a.m.