pbd_numspec_mean_checked: Calcates the mean number of species under protracted...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pbd_numspec_checked.R

Description

Calcates the mean number of species under protracted birth-death model of diversification. This is a checked version with a more explicit interface than pbd_numspec_mean.

Usage

1
pbd_numspec_mean_checked(ergs, eris, scrs, sirs, crown_ages)

Arguments

ergs

one or more good species' extinction rates

eris

one or more incipient species' extinction rates

scrs

one or more speciation completion rates

sirs

one or more speciation initiation rates. This function assumes the speciation initiation rates of good and incipient species are equal.

crown_ages

one or more crown ages

Value

The expected number of representative species

Author(s)

Richel J.C. Bilderbeek

See Also

pbd_numspec_mean provides for setting a time-dependence in the parameters and/or specify a stem age. pbd_numspec_median_checked calculates the median number of species.

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
  n <- pbd_numspec_mean_checked(
    ergs = 0.1,
    eris = 0.2,
    scrs = 0.3,
    sirs = 0.4,
    crown_ages = 0.5
  )
  testthat::expect_equal(n, 1.029111871)

  n <- pbd_numspec_mean_checked(
    ergs = 0.2,
    eris = 0.4,
    scrs = 0.6,
    sirs = 0.8,
    crown_ages = 1.0
  )
  testthat::expect_equal(n, 1.440746567)

  # Vectorized use
  ns <- pbd_numspec_mean_checked(
    ergs = c(0.1, 0.2),
    eris = c(0.2, 0.4),
    scrs = c(0.3, 0.6),
    sirs = c(0.4, 0.8),
    crown_ages = c(0.5, 1.0)
  )
  testthat::expect_equal(ns, c(1.029111871, 1.440746567))

richelbilderbeek/becosys documentation built on Oct. 19, 2020, 9:20 a.m.