The expected number of endemics and non-endemics under the DAISIE model
Source:R/DAISIE_ExpEIN.R
DAISIE_ExpEIN2.Rd
This function calculates the expected number of endemics, non-endemics and the sum of these for a given set of parameter values, a given mainland species pool size and a given time, where there can be diversity-dependence
Usage
DAISIE_ExpEIN2(
tvec,
pars,
M,
initEI = NULL,
res = 1000,
ddmodel = 11,
methode = "ode45",
reltolint = 1e-16,
abstolint = 1e-16
)
Arguments
- tvec
The times at which the probabilities need to be computed.
- 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 modelpars[7]
: mu (extinction rate) for either type 2 species or rate set 2 in rate shift modelpars[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 modelpars[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 therelaxed_par
argument is the mean of the gamma distribution for the relaxed parameter.- M
Numeric defining the size of mainland pool, i.e. the number of species that can potentially colonize the island.
- initEI
The initial values for the number of endemics and non-endemics. In
DAISIE_probdist()
orDAISIE_margprobdist()
either this or initprobs must be NULL. InDAISIE_numcol()
when it is NULL, it is assumed that the island is empty.- res
Sets the maximum number of species for which a probability must be computed, must be larger than the size of the largest clade.
- ddmodel
Sets the model of diversity-dependence:
ddmodel = 0 : no diversity dependence
ddmodel = 1 : linear dependence in speciation rate
ddmodel = 11: linear dependence in speciation rate and in immigration rate
ddmodel = 2 : exponential dependence in speciation rate
ddmodel = 21: exponential dependence in speciation rate and in immigration rate
- methode
Method of the ODE-solver. Supported Boost
ODEINT
solvers (steppers) are:"odeint::runge_kutta_cash_karp54"
"odeint::runge_kutta_fehlberg78"
"odeint::runge_kutta_dopri5"
"odeint::bulirsch_stoer"
withoutodeint::
-prefix,ode
method is assumed. The default method overall is"lsodes"
forDAISIE_ML_CS()
and"ode45"
fromode()
forDAISIE_ML_IW()
.- reltolint
Numeric relative tolerance of the integration
- abstolint
Numeric absolute tolerance of the integration
Value
- tot_expEIN
The output is a list with three elements:
ExpE
The number of endemic species at the times in tvecExpI
The number of non-endemic species at the times in tvecExpN
The sum of the number of endemics and non-endemics at the times in tvec
Examples
DAISIE_ExpEIN2(tvec = c(0.000001,0.5,0.75,1),
pars = c(0.3,0.1,10,1,0.1),
M = 1000,
initEI = rbind(c(1,0),c(2,0),c(0,1)))
#> $ExpE
#> [1] 3.000001 68.398821 136.540451 219.906946
#>
#> $ExpI
#> [1] 1.000998 353.637331 452.384821 519.722809
#>
#> $ExpN
#> [1] 4.000999 422.036152 588.925273 739.629755
#>