redundancy: Use Redundancy Rule to Simulate Ecological Diversification of...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/redundancy.R

Description

Implement Monte Carlo simulation of a biota undergoing ecological diversification using the redundancy rule.

Usage

1
redundancy(nreps = 1, Sseed, Smax, ecospace, strength = 1)

Arguments

nreps

Vector of integers (such as a sequence) specifying sample number produced. Only used when function is applied within lapply or related function. Default nreps = 1 or any other integer produces a single sample.

Sseed

Integer giving number of species (or other taxa) to use at start of simulation.

Smax

Maximum number of species (or other taxa) to include in simulation.

ecospace

An ecospace framework (functional trait space) of class ecospace.

strength

Strength parameter controlling probability that redundancy rule is followed during simulation. Values must range between strength = 1 (default, rules always implemented) and strength = 0 (rules never implemented).

Details

Simulations are implemented as Monte Carlo processes in which species are added iteratively to assemblages, with all added species having their character states specified by the model rules, here the 'redundancy' rule. Simulations begin with the seeding of Sseed number of species, chosen at random (with replacement) from either the species pool (if provided in the weight.file when building the ecospace framework using create_ecospace) or following the neutral-rule algorithm (if a pool is not provided). Once seeded, the simulations proceed iteratively (character-by-character, species-by-species) by following the appropriate algorithm, as explained below, until terminated at Smax.

Redundancy rule algorithm: Pick one existing species at random and create a new species using that species' characters as a template. A character is modified (using a random multinomial draw from the ecospace framework) according to the strength parameter. Default strength = 1 always implements the redundancy rule, whereas strength = 0 never implements it (essentially making the simulation follow the neutral rule.) Because new character states can be any allowed by the ecospace framework, there is the possibility of obtaining redundancy greater than that specified by a strength parameter less than 1 (if, for example, the new randomly chosen character states are identical to those of the template species).

Redundancy rules tend to produce ecospaces with discrete clusters of functionally similar species. Additional details on the redundancy simulation are provided in Novack-Gottshall (2016a,b), including sensitivity to ecospace framework (functional trait space) structure, recommendations for model selection, and basis in ecological and evolutionary theory.

Value

Returns a data frame with Smax rows (representing species) and as many columns as specified by number of characters/states (functional traits) in the ecospace framework. Columns will have the same data type (numeric, factor, ordered numeric, or ordered factor) as specified in the ecospace framework.

Note

The function has been written to allow usage (using lapply or some other list-apply function) in 'embarrassingly parallel' implementations in a high-performance computing environment.

Author(s)

Phil Novack-Gottshall pnovack-gottshall@ben.edu

References

Bush, A. and P.M. Novack-Gottshall. 2012. Modelling the ecological-functional diversification of marine Metazoa on geological time scales. Biology Letters 8: 151-155.

Novack-Gottshall, P.M. 2016a. General models of ecological diversification. I. Conceptual synthesis. Paleobiology 42: 185-208.

Novack-Gottshall, P.M. 2016b. General models of ecological diversification. II. Simulations and empirical applications. Paleobiology 42: 209-239.

See Also

create_ecospace, neutral, partitioning, expansion

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Create an ecospace framework with 15 3-state factor characters
# Can also accept following character types: "numeric", "ord.num", "ord.fac"
nchar <- 15
ecospace <- create_ecospace(nchar = nchar, char.state = rep(3, nchar),
  char.type = rep("factor", nchar))

# Single (default) sample produced by redundancy function (with strength = 1):
Sseed <- 5
Smax <- 50
x <- redundancy(Sseed = Sseed, Smax = Smax, ecospace = ecospace)
head(x, 10)

# Plot results, showing order of assembly
# (Seed species in red, next 5 in black, remainder in gray)
# Notice the redundancy model produces an ecospace with discrete clusters of life habits
seq <- seq(nchar)
types <- sapply(seq, function(seq) ecospace[[seq]]$type)
if(any(types == "ord.fac" | types == "factor")) pc <- prcomp(FD::gowdis(x)) else
  pc <- prcomp(x)
plot(pc$x, type = "n", main = paste("Redundancy model,\n", Smax, "species"))
text(pc$x[,1], pc$x[,2], labels = seq(Smax), col = c(rep("red", Sseed), rep("black", 5),
  rep("slategray", (Smax - Sseed - 5))), pch = c(rep(19, Sseed), rep(21, (Smax - Sseed))),
  cex = .8)

# Change strength parameter so new species are 95% identical:
x <- redundancy(Sseed = Sseed, Smax = Smax, ecospace = ecospace, strength = 0.95)
if(any(types == "ord.fac" | types == "factor")) pc <- prcomp(FD::gowdis(x)) else
  pc <- prcomp(x)
plot(pc$x, type = "n", main = paste("Redundancy model,\n", Smax, "species"))
text(pc$x[,1], pc$x[,2], labels = seq(Smax), col = c(rep("red", Sseed), rep("black", 5),
  rep("slategray", (Smax - Sseed - 5))), pch = c(rep(19, Sseed), rep(21, (Smax - Sseed))),
  cex = .8)

# Create 5 samples using multiple nreps and lapply (can be slow)
nreps <- 1:5
samples <- lapply(X = nreps, FUN = redundancy, Sseed = 5, Smax = 50, ecospace)
str(samples)

ecospace documentation built on July 8, 2020, 5:54 p.m.