DAISIE_calc_sumstats_pcrates: Calculate summary statistics of per capita rates

View source: R/DAISIE_sumstats_rates.R

DAISIE_calc_sumstats_pcratesR Documentation

Calculate summary statistics of per capita rates

Description

Calculates the summary statistics of per capita rates throught an ontogeny simulation

Usage

DAISIE_calc_sumstats_pcrates(
  pars,
  total_time,
  area_pars,
  hyper_pars,
  island_ontogeny = 1,
  sea_level = 0,
  extcutoff = 100,
  mainland_n = 1000,
  resol = 100
)

Arguments

pars

A numeric vector containing the model parameters:

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

  • pars[2]: mu (extinction rate)

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

  • pars[4]: gamma (immigration rate)

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

  • pars[6]: lambda^c (cladogenesis rate) for either type 2 species or rate set 2 in rate shift model

  • pars[7]: mu (extinction rate) for either type 2 species or rate set 2 in rate shift model

  • pars[8]: K (carrying capacity) for either type 2 species or rate set 2 in rate shift model, set K=Inf for diversity independence.

  • pars[9]: gamma (immigration rate) for either type 2 species or rate set 2 in rate shift model

  • pars[10]: lambda^a (anagenesis rate) for either type 2 species or rate set 2 in rate shift model

Elements 6:10 are required only when type 2 species are included or in the rate shift model. For DAISIE_sim_relaxed_rate() pars[6] is the standard deviation of the gamma distribution for the relaxed parameter and the parameter chosen by the relaxed_par argument is the mean of the gamma distribution for the relaxed parameter.

total_time

Numeric defining the length of the simulation in time units.

area_pars

A named list containing area and sea level parameters as created by create_area_pars():

  • [1]: maximum area

  • [2]: current area

  • [3]: value from 0 to 1 indicating where in the island's history the peak area is achieved

  • [4]: total island age

  • [5]: amplitude of area fluctuation from sea level

  • [6]: frequency of sine wave of area change from sea level

  • [7]: angle of the slope of the island

hyper_pars

A named list of numeric hyperparameters for the rate calculations as returned by create_hyper_pars():

  • [1]: is d the scaling parameter for exponent for calculating cladogenesis rate

  • [2]: is x the exponent for calculating extinction rate

island_ontogeny

In DAISIE_sim_time_dep(), DAISIE_ML_CS and plotting a string describing the type of island ontogeny. Can be "const", "beta" for a beta function describing area through time. String checked by is_island_ontogeny_input().
In all other functions a numeric describing the type of island ontogeny. Can be 0 for constant, 1 for a beta function describing area through time. In ML functions island_ontogeny = NA assumes constant ontogeny. Time dependent estimation is not yet available as development is still ongoing. Will return an error if called in that case.

sea_level

In DAISIE_sim_time_dep() and plotting a string describing the type of sea level. Can be "const" or "sine" for a sine function describing area through time. String checked by is_sea_level_input().
In all other functions a numeric describing the type of sea level. Can be 0 for constant, 1 for a sine function describing area through time.

extcutoff

A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation.

mainland_n

A numeric stating the number of mainland species, that is the number of species that can potentially colonize the island. If using a clade-specific diversity dependence, this value is set to 1. If using an island-wide diversity dependence, this value is set to the number of mainland species.

resol

numeric for resolution of summary stats calculation. Should be > 1.

Value

A named list with mean and median values of specified parameters

Author(s)

Pedro Neves

Examples

pars <- c(0.01, 1, 20, 0.01, 1)
area_pars <- create_area_pars(
  max_area = 13500,
  current_area = 3500,
  proportional_peak_t = 0.1,
  total_island_age = 15,
  sea_level_amplitude = 0,
  sea_level_frequency = 0,
  island_gradient_angle = 0
)
hyper_pars <- create_hyper_pars(d = 0.2, x = 0.1)
island_ontogeny <- 1
sea_level <- 0
extcutoff <- 1100
resol <- 100
total_time <- 10
mainland_n <- 1000

mean_med <- DAISIE:::DAISIE_calc_sumstats_pcrates(
  pars = pars,
  total_time = total_time,
  area_pars = area_pars,
  hyper_pars = hyper_pars,
  island_ontogeny = island_ontogeny,
  sea_level = sea_level,
  extcutoff = extcutoff,
  mainland_n = mainland_n,
  resol = resol
)

DAISIE documentation built on June 2, 2022, 5:07 p.m.