Simulates island replicates with an guild-wide (GW) diversity-dependent process
Source:R/DAISIE_sim_cr_gw.R
DAISIE_sim_cr_gw.Rd
Simulates island replicates with an guild-wide (GW) diversity-dependent process
Usage
DAISIE_sim_cr_gw(
total_time,
M,
pars,
replicates,
nonoceanic_pars,
num_guilds,
sample_freq,
hyper_pars,
area_pars,
verbose
)
Arguments
- total_time
Numeric defining the length of the simulation in time units.
- M
Numeric defining the size of mainland pool, i.e. the number of species that can potentially colonize the island.
- 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.- replicates
Integer specifying number of island replicates to be simulated.
- nonoceanic_pars
A vector of length two with:
[1]: the probability of sampling a species from the mainland
[2]: the probability of the species sampled from the mainland being nonendemic
- num_guilds
The number of guilds on the mainland. The number of mainland species is divided by the number of guilds when
divdepmodel = "GW"
- sample_freq
Numeric specifing the number of units times should be divided by for plotting purposes. Larger values will lead to plots with higher resolution, but will also run slower.
- 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
- 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
- verbose
A numeric vector of length 1, which in simulations and `DAISIEdataprep()` can be `1` or `0`, where `1` gives intermediate output should be printed. For ML functions a numeric determining if intermediate output should be printed. The default: `0` does not print, `1` prints the initial likelihood and the settings that were selected (which parameters are to be optimised, fixed or shifted), `2` prints the same as `1 and also the intermediate output of the parameters and loglikelihood, while `3` the same as `2` and prints intermediate progress during likelihood computation.