# comTS: Simulating time series for ecological communities In comstab: Partitioning the Drivers of Stability of Ecological Communities

 comTS R Documentation

## Simulating time series for ecological communities

### Description

`comTS()` is a function used to simulate `com`munity `T`ime `S`eries based on custom parameters.

### Usage

``````comTS(nsp, ny, even, mvs, sync = c("-2", "-1", "0", "1", "2"))
``````

### Arguments

 `nsp` Number of species in the community `(integer)`. `ny` Length of the time series in years `(integer > 5)`. `even` Parameter of the geometric rank-abundance curve ranging between 0 and 1 `(numeric)` . `mvs` Scaling coefficient of the mean-variance relationship ranging between 1 and 2 `(numeric)`. `sync` Level of synchrony between species `(factor)`: `"0"`: independant fluctuations. `"1"`: positive synchrony. `"2"`: high positive synchrony. `"-1"`: anti-synchronous fluctuations. `"-2"`: high anti-synchronous fluctuations.

### Details

The simulation produces temporal series of abundances of `'nsp'` species for `'ny'` years. The mean abundance of each species is determined by a geometric series of `'nsp'` values using a constant `'even'` ratio between successive terms. Hence, a high `'even'` value means a community with even species abundances while a low `'even'` means a strongly dominated community. Species temporal variances are calculated following Taylorâ€™s power law, using with a `'mvs'` scaling coefficient. Finally, for each species, the `'ny'` abundance values are sampled from a normal distribution with the corresponding species parameters, and bounded to positive values. Since each species is simulated independently of others, the resulting simulation can be used to describe a community where the `'nsp'` species fluctuate independently (`'sync'` = "0"). To simulate an overall positive synchrony (`'sync'` = "1"), the temporal sequences of each species are sorted to maximize the number of years with all species having values above or below their respective median (one random selection among many possible combinations). A stabilizing negative synchrony (`'sync'` = "-1") is simulated by sorting the temporal sequences of each species to maximize the number of years where successively abundant species have values above and below their respective median (one random selection among many possible combinations). High positive synchrony (`'sync'` = "2") and high negative synchrony (`'sync'` = "-2") are generated using a similar approach but sorting values based on four quartiles instead of using the median only.

The simulation uses a simplistic approach where species fluctuations are not related to any underlying environmental factor nor demographic parameters. Consequently, the temporal order of the simulated abundances for each species cannot be considered realistic. Nevertheless, this simplification has little influence on the analyses performed in this `R` package since none of the indices calculated depend on the temporal order of individual series, but rather describe the overall variability and temporal coordination of species.

### Value

A `matrix` of `'ny'` rows and `'nsp'` columns, containing numerical values of species abundances. The parameters used to compute species values (even, mvs, and sync) are stored as attributes of the matrix.

### Author(s)

Jules Segrestin, jsegrestin@gmail.com

### Examples

``````require(stats)

comTS(nsp = 10, ny = 30, even = 0.6, mvs = 1.5, sync = "0")

``````

comstab documentation built on May 29, 2024, 8:38 a.m.