sim_island_with_mainland: Simulate oceanic islands with mainland extinction given...

View source: R/sim_island_with_mainland.R

sim_island_with_mainlandR Documentation

Simulate oceanic islands with mainland extinction given parameters under time-constant rates.

Description

This function simulates islands with given cladogenesis, extinction, carrying capacity, immigration and anagenesis parameters, and simulates the mainland given an extinction rate parameter, all of which are modelled as time-constant parameters.

Usage

sim_island_with_mainland(
  total_time,
  m,
  island_pars,
  mainland_ex,
  mainland_sample_prob,
  mainland_sample_type,
  replicates,
  verbose = FALSE
)

Arguments

total_time

Numeric defining the length of the simulation in time units.

m

Numeric defining the size of mainland pool.

island_pars

A numeric vector containing the parameters for the island:

  • island_pars[1]: lambda^c (cladogenesis rate)

  • island_pars[2]: mu (extinction rate)

  • island_pars[3]: K (carrying capacity), set K=Inf for diversity independence.

  • island_pars[4]: gamma (immigration rate)

  • island_pars[5]: lambda^a (anagenesis rate)

mainland_ex

Numeric parameter for mainland extinction rate.

mainland_sample_prob

Numeric between zero and one determining the probability of an extant mainland species being sampled.

mainland_sample_type

String either "unsampled" for unsampled known species on the mainland, "undiscovered" for undiscovered species on the mainland, or "complete" if the mainland sampling probability is one.

replicates

Integer specifying number of island replicates to be simulated.

verbose

Logical, determining if progress output should be printed during the simulation.

Value

A list. The highest level of the list has two elements called ideal_islands and empirical_islands which corresponds to the ideal and empirical data sets produce in each simulation. Within each ideal_islands and empirical_islands each element is an individual replicate. The first element of each replicate is composed of island information containing:

⁠$island_age⁠

A numeric with the island age.

⁠$not_present⁠

the number of mainland lineages that are not present on the island.

The subsequent elements of the list pertaining to each replicate contain information on a single colonist lineage on the island and have 3 components:

⁠$branching_times⁠

island age and stem age of the population/species in the case of Non-endemic, Non-endemic_MaxAge and Endemic anagenetic species. For cladogenetic species these should be island age and branching times of the radiation including the stem age of the radiation.

⁠$stac⁠

An integer ranging from 1 to 6 indicating the status of the colonist:

  1. Non_endemic_MaxAge

  2. Endemic

  3. Endemic&Non_Endemic

  4. Non_endemic_MaxAge

  5. Endemic_singleton_MaxAge

  6. Endemic_clade_MaxAge

missing_species

number of island species that were not sampled for particular clade (only applicable for endemic clades)

Author(s)

Joshua W. Lambert

Examples

## Simulate 2 islands (replicates) for 1 million years, with a mainland
## extinction rate of 1 (SpMy^-1). Pool size 100.

set.seed(
  1,
  kind = "Mersenne-Twister",
  normal.kind = "Inversion",
  sample.kind = "Rejection"
)
island <- sim_island_with_mainland(
  total_time = 1,
  m = 100,
  island_pars = c(1, 1, 10, 0.1, 1),
  mainland_ex = 1,
  mainland_sample_prob = 1,
  mainland_sample_type = "undiscovered",
  replicates = 2,
  verbose = FALSE
)

joshwlambert/DAISIEmainland documentation built on July 14, 2024, 5:40 p.m.