Title: | Dynamical Assembly of Islands by Speciation, Immigration and Extinction |
---|---|
Description: | Simulates and computes the (maximum) likelihood of a dynamical model of island biota assembly through speciation, immigration and extinction. See Valente et al. (2015) <doi:10.1111/ele.12461>. |
Authors: | Rampal S. Etienne [aut, cre] , Luis Valente [aut] , Albert B. Phillimore [aut] , Bart Haegeman [aut] , Joshua W. Lambert [aut] , Pedro Santos Neves [aut] , Shu Xie [aut] , Richèl J.C. Bilderbeek [aut] , Hanno Hildenbrandt [aut] , Torsten Hauffe [ctb] , Giovanni Laudanno [ctb] , Nadiah Kristensen [ctb] , Raphael Scherrer [ctb] |
Maintainer: | Rampal S. Etienne <[email protected]> |
License: | GPL (>= 3) | file LICENSE |
Version: | 4.4.1 |
Built: | 2024-10-29 05:19:19 UTC |
Source: | https://github.com/rsetienne/daisie |
Add a column to a data frame
add_column_to_dataframe(df, position, column_to_insert)
add_column_to_dataframe(df, position, column_to_insert)
df |
data frame to add the column to |
position |
location in data frame where to insert the column. Position can also be a name of a column |
column_to_insert |
the elements of the column to insert. If the column has a name, this name will be copied into the data frame. Id is does not have a name, it will get the name "nc". |
A data frame with the column inserted
A dataframe with in subsequent columns the name of the archipelago (Archipelago) the area of the archipelago (Area), the age (Age) and the distance from the mainland (Distance)
A dataframe containing information on archipelago name, area, age and distance from the mainland
Valente L, Phillimore AB, Melo M, Warren BH, Clegg SM, Havenstein K,
Tiedemann R, Illera JC, Thébaud C, Aschenbach T, Etienne RS. A simple dynamic model
explains island bird diversity worldwide (2020) Nature, 579, 92-96
A datalist with 41 items representing the 41 archipelagos. Each archipelago can be called separately using archipelagos41[[x]] with x being a number between 1 and 41. Using archipelagos41[[x]][[1]] will show just the top part of the archipelago item where the archipelago name and physical features are displayed. The structure of each of the archipelagos is the same as regular DAISIE datalist generated using DAISIE_dataprep.
A datalist containing data on the 41 archipelagos studied in Valente et al 2020 (Main Dataset D1). Contains colonisation and branching times for bird species in each of the archipelagos. It also contains information on archipelago name, area, age and distance from the nearest mainland.
Valente L, Phillimore AB, Melo M, Warren BH, Clegg SM, Havenstein K,
Tiedemann R, Illera JC, Thébaud C, Aschenbach T, Etienne RS. A simple dynamic model
explains island bird diversity worldwide (2020) Nature, 579, 92-96
A list containing the colonization and branching times of the noctilionoid
bats of the Greater Antilles. Main dataset used in
Valente, Etienne and Dávalos (2017) Nature Ecology and Evolution. Island age 20 Myr and
mainland pool size of 100 species.
The first element of the list has two
components: $island_age
- the island age $not_present
- the number of mainland lineages that are not present
on the island
The following elements of the list each contain
information on a single colonist lineage on the island and has 5
components:$colonist_name
- the name of the species or clade
that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island clade including the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4
* Endemic_MaxAge: 5 or 6 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset all are equal to 1.
A list with 17 elements, the first of which contains 2 elements and the following 16 containing 5 components.
Valente L, Etienne RS, Dávalos (2017) Recent extinctions disturb path to
equilibrium diversity in Caribbean bats. Nature Ecology and Evolution, 1, 26.
DAISIE_dataprep
, DAISIE_ML
, DAISIE_SR_ML
A list containing the colonization and branching times of the fishes of
Lake Biwa (Japan). Main dataset used in Hauffe et al (2020). This list can be generated
using the DAISIE_dataprep function,
which converts a user-specified data table into a data object, but the
object can of course also be entered directly. It is an R list object with
the following elements.
The first element of the list has two
components: $island_age
- the island age $not_present
- the number of mainland lineages that are not present
on the island
The following elements of the list each contains
information on a single colonist lineage on the island and has 5
components:$colonist_name
- the name of the species or clade
that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island clade including the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4
* Endemic_MaxAge: 5 or 6 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset all are equal to 1.
A list with 69 elements, the first of which contains 2 elements and the following 68 containing 5 components.
Hauffe, T., D. Delicado, R.S. Etienne and L. Valente. Lake expansion
elevates equilibrium diversity via increasing colonisation. (2020) Journal of Biogeography
DAISIE_dataprep
, DAISIE_ML
, DAISIE_SR_ML
Create named list of area parameters
create_area_pars( max_area, current_area, proportional_peak_t, total_island_age, sea_level_amplitude, sea_level_frequency, island_gradient_angle )
create_area_pars( max_area, current_area, proportional_peak_t, total_island_age, sea_level_amplitude, sea_level_frequency, island_gradient_angle )
max_area |
Numeric defining maximum area. |
current_area |
A numeric with the current island area at present (i.e., at the end of the simulation). |
proportional_peak_t |
Numeric value from 0 to 1 indicating where in the island's history the peak area is achieved. |
total_island_age |
Numeric defining total island age. |
sea_level_amplitude |
Numeric defining amplitude of area fluctuation from sea level. |
sea_level_frequency |
Numeric defining frequency of sine wave of area change from sea level. |
island_gradient_angle |
Numeric defining the angle in degrees specifying the slope of the island. |
list of numerical values containing area and sea level parameters for island ontogeny simulation
Richel J.C Bilderbeek, Joshua Lambert, Pedro Neves
area_pars <- create_area_pars( max_area = 10, current_area = 1, proportional_peak_t = 0.5, total_island_age = 5, sea_level_amplitude = 5, sea_level_frequency = 10, island_gradient_angle = 0 )
area_pars <- create_area_pars( max_area = 10, current_area = 1, proportional_peak_t = 0.5, total_island_age = 5, sea_level_amplitude = 5, sea_level_frequency = 10, island_gradient_angle = 0 )
Creates the list object for CS_version argument in DAISIE_ML_CS
create_CS_version( model = 1, relaxed_par = NULL, par_sd = 0, par_upper_bound = Inf )
create_CS_version( model = 1, relaxed_par = NULL, par_sd = 0, par_upper_bound = Inf )
model |
the CS model to run, options are |
relaxed_par |
the parameter to relax (integrate over). Options are
|
par_sd |
standard deviation of the parameter to relax |
par_upper_bound |
upper bound of the parameter to relax |
A list of four elements
model: the CS model to run, options are 1
for single rate
DAISIE model, 2
for multi-rate DAISIE, or 0
for IW test
model
relaxed_par: the parameter to relax (integrate over).
par_sd: the standard deviation of the parameter to relax
par_upperbound: upper bound of the parameter to relax.
Create list of hyperparameters
create_hyper_pars(d, x)
create_hyper_pars(d, x)
d |
Numeric defining the scaling parameter for exponent for calculating cladogenesis rate. |
x |
Numeric defining the exponent for calculating extinction rate. |
Named list with hyperparameters
Pedro Neves, Joshua Lambert
hyper_pars <- create_hyper_pars(d = 0.027, x = 0.15)
hyper_pars <- create_hyper_pars(d = 0.027, x = 0.15)
Create vector of model parameters
create_pars(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate)
create_pars(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate)
clado_rate |
Numeric rate of cladogenesis |
ext_rate |
Numeric rate of extinction |
carr_cap |
Numeric carrying capacity |
immig_rate |
Numeric rate of immigration |
ana_rate |
Numeric rate of anagenesis |
Numeric vector with 5 elements
create_pars(clado_rate = 1, ext_rate = 1, carr_cap = 10, immig_rate = 0.1, ana_rate = 1)
create_pars(clado_rate = 1, ext_rate = 1, carr_cap = 10, immig_rate = 0.1, ana_rate = 1)
Create named list of trait state parameters
create_trait_pars( trans_rate, immig_rate2, ext_rate2, ana_rate2, clado_rate2, trans_rate2, M2 )
create_trait_pars( trans_rate, immig_rate2, ext_rate2, ana_rate2, clado_rate2, trans_rate2, M2 )
trans_rate |
A numeric with the per capita transition rate with state1 |
immig_rate2 |
A numeric with the per capita immigration rate with state2 |
ext_rate2 |
A numeric with the per capita extinction rate with state2 |
ana_rate2 |
A numeric with the per capita anagenesis rate with state2 |
clado_rate2 |
A numeric with the per capita cladogenesis rate with state2 |
trans_rate2 |
A numeric with the per capita transition rate with state2 |
M2 |
A numeric with the number of species with trait state 2 on mainland |
list of numerical values containing trait state parameters
trait_pars <- create_trait_pars( trans_rate = 0.5, immig_rate2 = 0.1, ext_rate2 = 0.2, ana_rate2 = 0.3, clado_rate2 = 0.4, trans_rate2 = 0.5, M2 = 1000 )
trait_pars <- create_trait_pars( trans_rate = 0.5, immig_rate2 = 0.1, ext_rate2 = 0.2, ana_rate2 = 0.3, clado_rate2 = 0.4, trans_rate2 = 0.5, M2 = 1000 )
Create named list of trait state parameters
create_trait_pars_2K( trans_rate, immig_rate2, ext_rate2, ana_rate2, clado_rate2, trans_rate2, M2, K2 )
create_trait_pars_2K( trans_rate, immig_rate2, ext_rate2, ana_rate2, clado_rate2, trans_rate2, M2, K2 )
trans_rate |
A numeric with the per capita transition rate with state1 |
immig_rate2 |
A numeric with the per capita immigration rate with state2 |
ext_rate2 |
A numeric with the per capita extinction rate with state2 |
ana_rate2 |
A numeric with the per capita anagenesis rate with state2 |
clado_rate2 |
A numeric with the per capita cladogenesis rate with state2 |
trans_rate2 |
A numeric with the per capita transition rate with state2 |
M2 |
A numeric with the number of species with trait state 2 on mainland |
K2 |
A numeric with the carrying capacity for state 2 |
list of numerical values containing trait state parameters
Sets or retrieves the factor to calculate the step-size used by the odeint::adams_bashforth[_moulton] solvers.
DAISIE_abm_factor(factor)
DAISIE_abm_factor(factor)
factor |
sets step-size to |
current factor
This function converts the joint distribution of the number of endemics and non-endemics from the matrix format of DAISIE_probdist to a list format
DAISIE_convertprobdist(pb)
DAISIE_convertprobdist(pb)
pb |
Probability distribution in matrix format as output by
|
A list of length nrow(pb) containing matrices of square dimensions of size sqrt(ncol - 1) containing the joint probabilities with endemics in the rows and non-endemics in the columns. The last element of the list is a vector a times at which the joint probability distribution is evaluated.
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Compute the probability distribution at t = 4 and t = 8, for a mainland pool # size of 250 potential colonists and a vector of 5 parameters (cladogenesis, extinction, # clade-level carrying capacity, immigration, anagenesis) starting from an empty # island; store in list format pb <- DAISIE_probdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(0,0), initprobs = NULL ) prob_dists <- DAISIE_convertprobdist(pb)
### Compute the probability distribution at t = 4 and t = 8, for a mainland pool # size of 250 potential colonists and a vector of 5 parameters (cladogenesis, extinction, # clade-level carrying capacity, immigration, anagenesis) starting from an empty # island; store in list format pb <- DAISIE_probdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(0,0), initprobs = NULL ) prob_dists <- DAISIE_convertprobdist(pb)
Calculates various island diversity metrics from island datasets.
DAISIE_count_species(islands, sort_clade_sizes = TRUE)
DAISIE_count_species(islands, sort_clade_sizes = TRUE)
islands |
Island datalist or simulated data in DAISIE datalist format. Can be a single island (empirical data) generated with DAISIE_dataprep or DAISIEprep. Can also be simulated data generated with DAISIE_sim function. |
sort_clade_sizes |
Default sort_clade_sizes = T outputs clade sizes sorted in ascending order of number of species. sort_clade_sizes=F outputs clade sizes in the same order as they appear in the input datalist. |
The output is a list containing the following items:
clade_sizes_sorted |
List showing the total number of species in each island clade (including missing species). Each item [[i]] on the list gives the sizes of all clades for a single island. If option sort_clade_sizes = T, the clade sizes for are sorted by increasing number of species. If option sort_clade_sizes = F the clade sizes are given in the same order as in the input datalist. |
size_largest_clade |
The total number of species in the largest island clade for each island. |
mean_clade_size |
Mean clade size (average of all island clades) |
number_colonisations |
The total number of colonisations (clades) on each island. |
total_number_species |
The total number of species on each island. These are the extant species at present, including missing species; in case of simulations, this is the number of species present on the island at the end of the simulation. |
Luis Valente
DAISIE_dataprep
,
DAISIE_plot_island
# Run function with clade sizes in the order they appear in the input data data("NewZealand_birds_datalist") species_count <- DAISIE_count_species(NewZealand_birds_datalist) # Run function with clade sizes in ascending order species_count_sorted <- DAISIE_count_species( NewZealand_birds_datalist, sort_clade_sizes = TRUE )
# Run function with clade sizes in the order they appear in the input data data("NewZealand_birds_datalist") species_count <- DAISIE_count_species(NewZealand_birds_datalist) # Run function with clade sizes in ascending order species_count_sorted <- DAISIE_count_species( NewZealand_birds_datalist, sort_clade_sizes = TRUE )
Sets or retrieves the max. number of iterations used by the odeint solver.
DAISIE_CS_max_steps(max_steps)
DAISIE_CS_max_steps(max_steps)
max_steps |
|
current max. iterations
This function produces a data object that can be run in DAISIE likelihood computation/optimization functions. The function converts a user-specified table to a DAISIE-compatible format. See Galapagos_datatable.Rdata for a template of an input table.)
DAISIE_dataprep( datatable, island_age, M, number_clade_types = 1, list_type2_clades = NA, prop_type2_pool = "proportional", epss = 1e-05, verbose = TRUE )
DAISIE_dataprep( datatable, island_age, M, number_clade_types = 1, list_type2_clades = NA, prop_type2_pool = "proportional", epss = 1e-05, verbose = TRUE )
datatable |
Data frame (table) with user-specified data. See file
Galapagos_datatable.Rdata for a template of an input table. Each row on the
table represents and independent colonisation event. Table has the following
four columns. |
island_age |
Age of island in appropriate units |
M |
The size of the mainland pool, i.e the number of species that can potentially colonize the island |
number_clade_types |
Number of clade types. Default: number_clade_types = 1 all species are considered to belong to same macroevolutionary process. If number_clade_types = 2, there are two types of clades with distinct macroevolutionary processes. |
list_type2_clades |
If number_clade_types = 2, list_type2_clades specifies the names of the clades that have a distinct macroevolutionary process. The names must match those in the $Clade_name column of the source data table (e.g. list_type2_clades = "Finches"). If number_clade_types = 1, then list_type2_clades = NA should be specified (default) |
prop_type2_pool |
Specifies the fraction of potential mainland colonists that have a distinct macroevolutionary process. Applies only if number_clade_types = 2. Default "proportional" sets the fraction to be proportional to the number of clades of distinct macroevolutionary process that have colonised the island. Alternatively, the user can specify a value between 0 and 1 (e.g. if mainland pool size is 1000 and prop_type2_pool = 0.02 then number of type2 species is 20). |
epss |
Default= 1E-5 should be appropriate in most cases. This value is used to set the maximum age of colonisation of "Non_endemic_MaxAge" and "Endemic_MaxAge" species to an age that is slightly younger than the island for cases when the age provided for that species is older than the island. The new maximum age is then used as an upper bound to integrate over all possible colonisation times. |
verbose |
Boolean. States if intermediate results should be printed to
console. Defaults to |
The output is an R list containing the data formatted to be run on other DAISIE functions.
datalist |
R list object containing data: |
Luis M Valente
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Create Galapagos data object where all taxa have the same macroevolutionary process utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000 ) ### Create Galapagos data object with a distinct macroevolutionary processes # for the Darwin's finches. One process applies to type 1 species (all species # except for Darwin's finches) and the other applies only to type 2 species # (Darwin's finches). Set fraction of potential colonists of type 2 to be # proportional to the number of type2 clades present on the island. utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000, number_clade_types = 2, list_type2_clades = "Finches" ) ### Create Galapagos data object with a distinct macroevolutionary processes # for the Darwin's finches. One process applies to type 1 species (all species # except for Darwin's finches) and the other applies only to type 2 species # (Darwin's finches). Set fraction of potential colonists of type 2 to be 0.163. utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000, number_clade_types = 2, list_type2_clades = "Finches", prop_type2_pool = 0.163 )
### Create Galapagos data object where all taxa have the same macroevolutionary process utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000 ) ### Create Galapagos data object with a distinct macroevolutionary processes # for the Darwin's finches. One process applies to type 1 species (all species # except for Darwin's finches) and the other applies only to type 2 species # (Darwin's finches). Set fraction of potential colonists of type 2 to be # proportional to the number of type2 clades present on the island. utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000, number_clade_types = 2, list_type2_clades = "Finches" ) ### Create Galapagos data object with a distinct macroevolutionary processes # for the Darwin's finches. One process applies to type 1 species (all species # except for Darwin's finches) and the other applies only to type 2 species # (Darwin's finches). Set fraction of potential colonists of type 2 to be 0.163. utils::data(Galapagos_datatable, package = "DAISIE") DAISIE_dataprep( datatable = Galapagos_datatable, island_age = 4, M = 1000, number_clade_types = 2, list_type2_clades = "Finches", prop_type2_pool = 0.163 )
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
DAISIE_ExpEIN(t, pars, M, initEI = c(0, 0))
DAISIE_ExpEIN(t, pars, M, initEI = c(0, 0))
t |
The time at which the expectations need to be computed. |
pars |
A numeric vector containing the model parameters:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
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 |
out |
The output is a list with three elements: |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Compute the expected values at t = 4, for a mainland pool size of 1000 potential # colonists and a vector of 5 parameters (cladogenesis, extinction, clade-level carrying # capacity, immigration, anagenesis) DAISIE_ExpEIN( t = 4, pars = c(0.5,0.1,Inf,0.01,0.4), M = 1000 )
### Compute the expected values at t = 4, for a mainland pool size of 1000 potential # colonists and a vector of 5 parameters (cladogenesis, extinction, clade-level carrying # capacity, immigration, anagenesis) DAISIE_ExpEIN( t = 4, pars = c(0.5,0.1,Inf,0.01,0.4), M = 1000 )
Formats clade-specific simulation output into standard DAISIE list output with complete STT table
DAISIE_format_CS_full_stt( island_replicates, time, M, verbose = TRUE, trait_pars = NULL )
DAISIE_format_CS_full_stt( island_replicates, time, M, verbose = TRUE, trait_pars = NULL )
island_replicates |
List output from
|
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
M |
Numeric defining the size of mainland pool, i.e. the number of species that can potentially colonize 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. |
trait_pars |
A named list containing diversification rates considering
two trait states created by
|
List with CS DAISIE simulation output
Formats clade-specific simulation output into standard DAISIE list output with complete STT table
DAISIE_format_IW_full_stt(island_replicates, total_time, M, verbose)
DAISIE_format_IW_full_stt(island_replicates, total_time, M, verbose)
island_replicates |
List output from
|
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. |
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. |
List with IW DAISIE simulation output
Calculates information criterion from DAISIE ML estimates?
DAISIE_IC( datalist, initparsopt, idparsopt, parsfix, idparsfix, endmc = 1000, res = 100, cond = 0, ddmodel = 0 )
DAISIE_IC( datalist, initparsopt, idparsopt, parsfix, idparsfix, endmc = 1000, res = 100, cond = 0, ddmodel = 0 )
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object,
but the object can of course also be entered directly.
It is an R list object with the following elements. |
initparsopt |
The initial values of the parameters that must be optimized, they are all positive. |
idparsopt |
The ids of the parameters that must be optimized. The ids
are defined as follows: |
parsfix |
The values of the parameters that should not be optimized. |
idparsfix |
The ids of the parameters that should not be optimized, e.g. c(1,3) if lambda^c and K should not be optimized. |
endmc |
Numeric for how many simulations should run. |
res |
Sets the maximum number of species for which a probability must be computed, must be larger than the size of the largest clade. |
cond |
cond = 0 : conditioning on island age |
ddmodel |
Sets the model of diversity-dependence: |
List of two numerics with WIC and AICb
Sets or retrieves the number of threads used by the odeint solver.
DAISIE_IW_num_threads(num_threads)
DAISIE_IW_num_threads(num_threads)
num_threads |
|
number of threads
The maximum number of threads is limited to the value of the C++
standard library function std::thread::hardware_concurrency()
.
This is also the default number of threads upon library load.
Multithreading incurs some overhead. Therefore, single-threaded execution
might be faster for small systems.
Computes the loglikelihood of the DAISIE model given colonization and branching times for lineages on an island, and a set of model parameters for the DAISIE model with island-wide diversity-dependence
DAISIE_loglik_IW( pars1, pars2, datalist, methode = "lsodes", abstolint = 1e-12, reltolint = 1e-10, verbose = FALSE )
DAISIE_loglik_IW( pars1, pars2, datalist, methode = "lsodes", abstolint = 1e-12, reltolint = 1e-10, verbose = FALSE )
pars1 |
Contains the model parameters: |
pars2 |
Contains the model settings |
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object, but
the object can of course also be entered directly. It is an R list object
with the following elements. |
methode |
Method of the ODE-solver. Supported Boost |
abstolint |
Absolute tolerance of the integration |
reltolint |
Relative tolerance of the integration |
verbose |
Logical controling if progress is printed to console. |
The output is a loglikelihood value
The loglikelihood
Rampal S. Etienne & Bart Haegeman
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_ML_IW
, DAISIE_loglik_CS
,
DAISIE_sim_cr
This function calculates the marginal distribution of the number of endemics and non-endemics and their sum for a given set of parameter values, a given mainland species pool size and a given set of times
DAISIE_margprobdist( pars1, pars2, tvec, initEI = c(0, 0), initprobs = NULL, pb = NULL )
DAISIE_margprobdist( pars1, pars2, tvec, initEI = c(0, 0), initprobs = NULL, pb = NULL )
pars1 |
Vector of model parameters: |
pars2 |
Vector of settings: |
tvec |
The times at which the probabilities need to be computed. |
initEI |
The initial values for the number of endemics and
non-endemics. In |
initprobs |
The initial probability distribution for the number of endemics and non-endemics; either this or initEI must be NULL. |
pb |
Probability distribution in matrix format as output by
|
out |
A list of three vectors: |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Compute the marginal probability distributions at t = 4 and t = 8, for a mainland # pool size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting from # an empty island marg_prob_dists <- DAISIE_margprobdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(5,1), initprobs = NULL )
### Compute the marginal probability distributions at t = 4 and t = 8, for a mainland # pool size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting from # an empty island marg_prob_dists <- DAISIE_margprobdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(5,1), initprobs = NULL )
This function computes the maximum likelihood estimates of the parameters of
the DAISIE model with clade-specific diversity-dependence for data from
lineages colonizing an island. It also outputs the corresponding
loglikelihood that can be used in model comparisons.
The result of sort(c(idparsopt, idparsfix, idparsnoshift)) should be
identical to c(1:10). If not, an error is reported that the input is
incoherent. The same happens when the length of initparsopt is different
from the length of idparsopt, and the length of parsfix is different from
the length of idparsfix.
Including the 11th parameter (p_f) in either
idparsopt or idparsfix (and therefore initparsopt or parsfix) is optional.
If this parameter is not specified, then the information in the data is
used, otherwise the information in the data is overruled.
DAISIE_ML_CS( datalist, datatype = "single", initparsopt, idparsopt, parsfix, idparsfix, idparsnoshift = 6:10, idparsmat = NULL, res = 100, ddmodel = 0, cond = 0, island_ontogeny = NA, eqmodel = 0, x_E = 0.95, x_I = 0.98, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), jitter = 0, num_cycles = 1 )
DAISIE_ML_CS( datalist, datatype = "single", initparsopt, idparsopt, parsfix, idparsfix, idparsnoshift = 6:10, idparsmat = NULL, res = 100, ddmodel = 0, cond = 0, island_ontogeny = NA, eqmodel = 0, x_E = 0.95, x_I = 0.98, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), jitter = 0, num_cycles = 1 )
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object,
but the object can of course also be entered directly.
It is an R list object with the following elements. |
datatype |
Sets the type of data: 'single' for a single island or archipelago treated as one, and 'multiple' for multiple archipelagoes potentially sharing the same parameters. |
initparsopt |
The initial values of the parameters that must be optimized, they are all positive. |
idparsopt |
The ids of the parameters that must be optimized. The ids
are defined as follows: |
parsfix |
The values of the parameters that should not be optimized. |
idparsfix |
The ids of the parameters that should not be optimized, e.g. c(1,3) if lambda^c and K should not be optimized. |
idparsnoshift |
For datatype = 'single' only: The ids of the parameters that should not be different between two groups of species; This can only apply to ids 6:10, e.g. idparsnoshift = c(6,7) means that lambda^c and mu have the same values for both groups. |
idparsmat |
For datatype = 'multiple' only: Matrix containing the ids
of the parameters, linking them to initparsopt and parsfix. Per island
system we use the following order: |
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: |
cond |
cond = 0 : conditioning on island age |
island_ontogeny |
In |
eqmodel |
Sets the equilibrium constraint that can be used during the
likelihood optimization. Only available for datatype = 'single'. |
x_E |
Sets the fraction of the equlibrium endemic diversity above which the endemics are assumed to be in equilibrium; only active for eqmodel = 13 or 15. |
x_I |
Sets the fraction of the equlibrium non-endemic diversity above which the system is assumed to be in equilibrium; only active for eqmodel = 15. |
tol |
Sets the tolerances in the optimization. Consists of: |
maxiter |
Sets the maximum number of iterations in the optimization. |
methode |
Method of the ODE-solver. Supported Boost |
optimmethod |
Method used in likelihood optimization. Default is
'subplex' (see 'subplex()' for full details).
Alternative is |
CS_version |
a numeric or list. Default is 1 for the standard DAISIE model, for a relaxed-rate model a list with the following elements:
|
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. |
tolint |
Vector of two elements containing the absolute and relative tolerance of the integration. |
jitter |
Numeric for |
num_cycles |
The number of cycles the optimizer will go through. Default is 1. |
The output is a dataframe containing estimated parameters and maximum loglikelihood.
lambda_c |
gives the maximum likelihood estimate of lambda^c, the rate of cladogenesis |
mu |
gives the maximum likelihood estimate of mu, the extinction rate |
K |
gives the maximum likelihood estimate of K, the carrying-capacity |
gamma |
gives the maximum likelihood estimate of gamma, the immigration rate |
lambda_a |
gives the maximum likelihood estimate of lambda^a, the rate of anagenesis |
lambda_c2 |
gives the maximum likelihood estimate of lambda^c2, the rate of cladogenesis for the optional second group of species |
mu2 |
gives the maximum likelihood estimate of mu2, the extinction rate for the optional second group of species |
K2 |
gives the maximum likelihood estimate of K2, the carrying-capacity for the optional second group of species |
gamma2 |
gives the maximum likelihood estimate of gamma2, the immigration rate for the optional second group of species |
lambda_a2 |
gives the maximum likelihood estimate of lambda^a2, the rate of anagenesis for the optional second group of species |
loglik |
gives the maximum loglikelihood |
df |
gives the number of estimated parameters, i.e. degrees of feedom |
conv |
gives a message on convergence of optimization; conv = 0 means convergence |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852. <doi:10.1111/ele.12461>.
DAISIE_loglik_all
,
DAISIE_sim_cr
,
DAISIE_sim_time_dep
,
DAISIE_sim_cr_shift
cat(" ### When all species have the same rates, and we want to optimize all 5 parameters, # we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,20,0.009,1.01), ddmodel = 11, idparsopt = 1:5, parsfix = NULL, idparsfix = NULL ) ### When all species have the same rates, and we want to optimize all parameters # except K (which we set equal to Inf), we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,0.009,1.01), idparsopt = c(1,2,4,5), parsfix = Inf, idparsfix = 3 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, and we want to optimize all parameters except K (which we # set equal to Inf), fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(0.38,0.55,0.004,1.1,2.28), idparsopt = c(1,2,4,5,6), parsfix = c(Inf,Inf,0.163), idparsfix = c(3,8,11), idparsnoshift = c(7,9,10) ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, extinction and a different K, and we want to optimize all # parameters, fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, ddmodel = 11, initparsopt = c(0.19,0.09,0.002,0.87,20,8.9,15), idparsopt = c(1,2,4,5,6,7,8), parsfix = c(Inf,0.163), idparsfix = c(3,11), idparsnoshift = c(9,10) ) ### When all species have the same rates except that the finches have a different # rate of extinction, and we want to optimize all parameters except K (which we # set equal to Inf), and we also# want to estimate the fraction of finch species # in the mainland pool. we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(2.48,2.7,0.009,1.01,2.25,0.163), idparsopt = c(1,2,4,5,7,11), parsfix = c(Inf,Inf), idparsfix = c(3,8), idparsnoshift = c(6,9,10) ) ### When we have two islands with the same rates except for immigration and anagenesis rate, # and we want to optimize all parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = list(Galapagos_datalist,Galapagos_datalist), datatype = 'multiple', initparsopt = c(2.5,2.7,20,0.009,1.01,0.009,1.01), idparsmat = rbind(1:5,c(1:3,6,7)), idparsopt = 1:7, parsfix = NULL, idparsfix = NULL ) ### When we consider the four Macaronesia archipelagoes and set all parameters the same # except for rates of cladogenesis, extinction and immigration for Canary Islands, # rate of cladogenesis is fixed to 0 for the other archipelagoes, # diversity-dependence is assumed to be absent # and we want to optimize all parameters, we use: utils::data(Macaronesia_datalist) DAISIE_ML( datalist = Macaronesia_datalist, datatype = 'multiple', initparsopt = c(1.053151832,0.052148979,0.512939011,0.133766934,0.152763179), idparsmat = rbind(1:5,c(6,2,3,7,5),1:5,1:5), idparsopt = c(2,4,5,6,7), parsfix = c(0,Inf), idparsfix = c(1,3) ) ")
cat(" ### When all species have the same rates, and we want to optimize all 5 parameters, # we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,20,0.009,1.01), ddmodel = 11, idparsopt = 1:5, parsfix = NULL, idparsfix = NULL ) ### When all species have the same rates, and we want to optimize all parameters # except K (which we set equal to Inf), we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,0.009,1.01), idparsopt = c(1,2,4,5), parsfix = Inf, idparsfix = 3 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, and we want to optimize all parameters except K (which we # set equal to Inf), fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(0.38,0.55,0.004,1.1,2.28), idparsopt = c(1,2,4,5,6), parsfix = c(Inf,Inf,0.163), idparsfix = c(3,8,11), idparsnoshift = c(7,9,10) ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, extinction and a different K, and we want to optimize all # parameters, fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, ddmodel = 11, initparsopt = c(0.19,0.09,0.002,0.87,20,8.9,15), idparsopt = c(1,2,4,5,6,7,8), parsfix = c(Inf,0.163), idparsfix = c(3,11), idparsnoshift = c(9,10) ) ### When all species have the same rates except that the finches have a different # rate of extinction, and we want to optimize all parameters except K (which we # set equal to Inf), and we also# want to estimate the fraction of finch species # in the mainland pool. we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(2.48,2.7,0.009,1.01,2.25,0.163), idparsopt = c(1,2,4,5,7,11), parsfix = c(Inf,Inf), idparsfix = c(3,8), idparsnoshift = c(6,9,10) ) ### When we have two islands with the same rates except for immigration and anagenesis rate, # and we want to optimize all parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = list(Galapagos_datalist,Galapagos_datalist), datatype = 'multiple', initparsopt = c(2.5,2.7,20,0.009,1.01,0.009,1.01), idparsmat = rbind(1:5,c(1:3,6,7)), idparsopt = 1:7, parsfix = NULL, idparsfix = NULL ) ### When we consider the four Macaronesia archipelagoes and set all parameters the same # except for rates of cladogenesis, extinction and immigration for Canary Islands, # rate of cladogenesis is fixed to 0 for the other archipelagoes, # diversity-dependence is assumed to be absent # and we want to optimize all parameters, we use: utils::data(Macaronesia_datalist) DAISIE_ML( datalist = Macaronesia_datalist, datatype = 'multiple', initparsopt = c(1.053151832,0.052148979,0.512939011,0.133766934,0.152763179), idparsmat = rbind(1:5,c(6,2,3,7,5),1:5,1:5), idparsopt = c(2,4,5,6,7), parsfix = c(0,Inf), idparsfix = c(1,3) ) ")
This function computes the maximum likelihood estimates of the parameters of the DAISIE model with island-wide diversity-dependence for data from lineages colonizing an island. It also outputs the corresponding loglikelihood that can be used in model comparisons.
DAISIE_ML_IW( datalist, initparsopt, idparsopt, parsfix, idparsfix, res = 100, ddmodel = 11, cond = 0, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "ode45", optimmethod = "subplex", verbose = 0, tolint = c(1e-16, 1e-14), jitter = 0, num_cycles = 1 )
DAISIE_ML_IW( datalist, initparsopt, idparsopt, parsfix, idparsfix, res = 100, ddmodel = 11, cond = 0, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "ode45", optimmethod = "subplex", verbose = 0, tolint = c(1e-16, 1e-14), jitter = 0, num_cycles = 1 )
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object,
but the object can of course also be entered directly.
It is an R list object with the following elements. |
initparsopt |
The initial values of the parameters that must be optimized, they are all positive. |
idparsopt |
The ids of the parameters that must be optimized. The ids
are defined as follows: |
parsfix |
The values of the parameters that should not be optimized. |
idparsfix |
The ids of the parameters that should not be optimized, e.g. c(1,3) if lambda^c and K should not be optimized. |
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: |
cond |
cond = 0 : conditioning on island age |
tol |
Sets the tolerances in the optimization. Consists of: |
maxiter |
Sets the maximum number of iterations in the optimization. |
methode |
Method of the ODE-solver. Supported Boost |
optimmethod |
Method used in likelihood optimization. Default is
'subplex' (see 'subplex()' for full details).
Alternative is |
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. |
tolint |
Vector of two elements containing the absolute and relative tolerance of the integration. |
jitter |
Numeric for |
num_cycles |
The number of cycles the optimizer will go through. Default is 1. |
The result of sort(c(idparsopt, idparsfix)) should be identical to c(1:5).
If not, an error is reported that the input is incoherent. The same happens
when the length of initparsopt is different from the length of idparsopt,
and the length of parsfix is different from the length of idparsfix.
The output is a dataframe containing estimated parameters and maximum loglikelihood.
lambda_c |
gives the maximum likelihood estimate of lambda^c, the rate of cladogenesis |
mu |
gives the maximum likelihood estimate of mu, the extinction rate |
K |
gives the maximum likelihood estimate of K, the carrying-capacity |
gamma |
gives the maximum likelihood estimate of gamma, the immigration rate |
lambda_a |
gives the maximum likelihood estimate of lambda^a, the rate of anagenesis |
loglik |
gives the maximum loglikelihood |
df |
gives the number of estimated parameters, i.e. degrees of feedom |
conv |
gives a message on convergence of optimization; conv = 0 means convergence |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852. <DOI:10.1111/ele.12461>.
DAISIE_loglik_IW
, DAISIE_ML_CS
DAISIE_sim_cr
This function computes the maximum likelihood estimates of the parameters of the relationships between parameters of the DAISIE model (with clade-specific diversity-dependence) and island area and distance of the island to the mainland for data from lineages colonizing several islands/archipelagos. It also outputs the corresponding loglikelihood that can be used in model comparisons.
A note on the sigmoidal functions used in distance_dep: For anagenesis and cladogenesis, the functional relationship is k * (d/d0)^x/(1 + (d/d0)^x); for colonization the relationship is: k - k * (d/d0)^x/(1 + (d/d0)^x). The d0 parameter is the 11th parameter entered. In 'sigmoidal_col_ana', the 11th parameter is the d0 for colonization and the 12th is the d0 for anagenesis.
DAISIE_MW_ML( datalist, initparsopt, idparsopt, parsfix, idparsfix, res = 100, ddmodel = 11, cond = 0, island_ontogeny = NA, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), distance_type = "continent", distance_dep = "power", parallel = "local", cpus = 3, num_cycles = 1 )
DAISIE_MW_ML( datalist, initparsopt, idparsopt, parsfix, idparsfix, res = 100, ddmodel = 11, cond = 0, island_ontogeny = NA, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), distance_type = "continent", distance_dep = "power", parallel = "local", cpus = 3, num_cycles = 1 )
datalist |
Data object containing information on colonisation and branching times of species for several islands or archipelagos, as well as the area, isolation and age of each of the islands/archipelagos. See data(archipelagos41) for an example. |
initparsopt |
The initial values of the parameters that must be optimized; they are all positive |
idparsopt |
The ids of the parameters that must be optimized. The ids
are defined as follows (see Valente et al 2020 Supplementary Tables 1 and 2
a better explanation of the models and parameters): |
parsfix |
The values of the parameters that should not be optimized |
idparsfix |
The ids of the parameters that should not be optimized, e.g. c(1,3) if lambda^c and K should not be optimized. |
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: |
cond |
cond = 0 : conditioning on island age |
island_ontogeny |
type of island ontonogeny. If NA, then constant ontogeny is assumed |
tol |
Sets the tolerances in the optimization. Consists of: |
maxiter |
Sets the maximum number of iterations in the optimization |
methode |
Method of the ODE-solver. See package deSolve for details. Default is "lsodes" |
optimmethod |
Method used in likelihood optimization. Default is "subplex" (see subplex package). Alternative is 'simplex' which was the method in previous versions. |
CS_version |
a numeric or list. Default is 1 for the standard DAISIE model, for a relaxed-rate model a list with the following elements:
|
verbose |
sets whether parameters and likelihood should be printed (1) or not (0) |
tolint |
Vector of two elements containing the absolute and relative tolerance of the integration |
distance_type |
Use 'continent' if the distance to the continent should be used, use 'nearest_big' if the distance to the nearest big landmass should be used, and use 'biologically_realistic' if the distance should take into account some biologically realism, e.g. an average of the previous two if both are thought to contribute. |
distance_dep |
Sets what type of distance dependence should be used.
Default is a power law, denoted as 'power' (models M1-14 in Valente et al 2020).
Alternatives are additive or interactive contributions of distance and area
to the rate of cladogenesis ("area_additive_clado"; "area_interactive_clado",
"area_interactive_clado1" and "area_interactive_clado2"). Other alternatives are
exponential relationship denoted by 'exp'; or sigmoids, either
'sigmoidal_col' for a sigmoid in the colonization, 'sigmoidal_ana' for sigmoidal anagenesis,
'sigmoidal_clado' for sigmoidal cladogenesis, and 'sigmoidal_col_ana' for
sigmoids in both colonization and anagenesis. |
parallel |
Sets whether parallel computation should be used. Use 'no' if no parallel computing should be used, 'cluster' for parallel computing on a unix/linux cluster, and 'local' for parallel computation on a local machine. |
cpus |
Number of cpus used in parallel computing. Default is 3. Will not have an effect if parallel = 'no'. |
num_cycles |
The number of cycles the optimizer will go through. Default is 1. |
The output is a dataframe containing estimated parameters and maximum loglikelihood.
lambda_c0 |
gives the maximum likelihood estimate of lambda^c, the rate of cladogenesis for unit area |
y |
gives the maximum likelihood estimate of y, the exponent of area for the rate of cladogenesis |
mu0 |
gives the maximum likelihood estimate of mu0, the extinction rate |
x |
gives the maximum likelihood estimate of x, the exponent of 1/area for the extinction rate |
K0 |
gives the maximum likelihood estimate of K0, the carrying-capacity for unit area |
z |
gives the maximum likelihood estimate of z, the exponent of area for the carrying capacity |
gamma0 |
gives the maximum likelihood estimate of gamma0, the immigration rate for unit distance |
y |
gives the maximum likelihood estimate of alpha, the exponent of 1/distance for the rate of colonization |
lambda_a0 |
gives the maximum likelihood estimate of lambda^a0, the rate of anagenesis for unit distance |
beta |
gives the maximum likelihood estimate of beta, the exponent of 1/distance for the rate of anagenesis |
loglik |
gives the maximum loglikelihood |
df |
gives the number of estimated parameters, i.e. degrees of feedom |
conv |
gives a message on convergence of optimization; conv = 0 means convergence |
Rampal S. Etienne & Luis Valente
Valente L, Phillimore AB, Melo M, Warren BH, Clegg SM, Havenstein K, Tiedemann R, Illera JC, Thébaud C, Aschenbach T, Etienne RS. A simple dynamic model explains island bird diversity worldwide (2020) Nature, 579, 92-96
cat(" ### Fit the M19 model as in Valente et al 2020, using the ML parameters as starting values (see Supplementary Tables 1 and 2). utils::data(archipelagos41) DAISIE_MW_ML( datalist= archipelagos41, initparsopt = c(0.040073803, 1.945656546, 0.150429656, 67.25643672, 0.293635061, 0.059096872, 0.382688527, 0.026510781), idparsopt = c(1,3,4,7,8,9,10,11), parsfix = c(0,Inf,0) , idparsfix = c(2,5,6), res = 100, ddmodel = 0, methode = 'lsodes', cpus = 4, parallel = 'local', optimmethod = 'subplex', tol = c(1E-4, 1E-5, 1E-7), distance_type = 'continent', distance_dep = 'area_interactive_clado' ) ")
cat(" ### Fit the M19 model as in Valente et al 2020, using the ML parameters as starting values (see Supplementary Tables 1 and 2). utils::data(archipelagos41) DAISIE_MW_ML( datalist= archipelagos41, initparsopt = c(0.040073803, 1.945656546, 0.150429656, 67.25643672, 0.293635061, 0.059096872, 0.382688527, 0.026510781), idparsopt = c(1,3,4,7,8,9,10,11), parsfix = c(0,Inf,0) , idparsfix = c(2,5,6), res = 100, ddmodel = 0, methode = 'lsodes', cpus = 4, parallel = 'local', optimmethod = 'subplex', tol = c(1E-4, 1E-5, 1E-7), distance_type = 'continent', distance_dep = 'area_interactive_clado' ) ")
This function calculates expectation and marginal distribution of the number of colonizations (lineages) for a given set of parameter values, a given mainland species pool size and a given set of times
DAISIE_numcol(pars1, pars2, tvec, initEI = NULL)
DAISIE_numcol(pars1, pars2, tvec, initEI = NULL)
pars1 |
Vector of model parameters: |
pars2 |
Vector of settings: |
tvec |
The times at which the probabilities need to be computed. |
initEI |
The initial values for the number of endemics and
non-endemics. In |
out |
A list of three vectors: |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Compute the marginal probability distributions at t = 4 and t = 8, for a mainland # pool size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting from # an empty island numcol <- DAISIE_numcol( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = list(c(0,1),c(0,2),c(3,1)) )
### Compute the marginal probability distributions at t = 4 and t = 8, for a mainland # pool size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting from # an empty island numcol <- DAISIE_numcol( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = list(c(0,1),c(0,2),c(3,1)) )
Driver for the boost::odeint solver for the CS model
Object of type 'state_type', which itself is 'vector_t'<double>, with the result of the integration depending on the runmod chosen.
Driver for the boost::odeint solver for the IW model
Plots clade age against clade diversity for all clades for which colonisation time is known.
DAISIE_plot_age_diversity( island, title = "Clade age vs clade diversity", island_age = NA )
DAISIE_plot_age_diversity( island, title = "Clade age vs clade diversity", island_age = NA )
island |
Island data object. Can be in DAISIE list format (see Galapagos_datalist and DAISIE_data_prep for examples) or in table format (see Galapagos_datatable for an example). |
title |
Title of the plot |
island_age |
Age of island in appropriate units. In
|
R plot showing for each clade in the island object the time of colonisation and the diversity of the clade. Only clades for which colonisation time is known are plotted. Blue - endemic; black - non-endemic. C = number of independent colonisations on island, N = number of species on the island
R plot.
Luis Valente
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr
,
DAISIE_sim_time_dep
,
DAISIE_sim_cr_shift
,
DAISIE_plot_island
### Plot Galapagos age-diversity for Galapagos dataset utils::data(Galapagos_datalist) DAISIE_plot_age_diversity(Galapagos_datalist)
### Plot Galapagos age-diversity for Galapagos dataset utils::data(Galapagos_datalist) DAISIE_plot_age_diversity(Galapagos_datalist)
Shows the phylogenies of the multiple clades present on the island
DAISIE_plot_input( trees, age = NULL, tcols = NULL, metadata = NULL, mapping = NULL, xlen = 0.001, pargs = NULL, bckgd = "white" )
DAISIE_plot_input( trees, age = NULL, tcols = NULL, metadata = NULL, mapping = NULL, xlen = 0.001, pargs = NULL, bckgd = "white" )
trees |
A list of trees, in phylo format, named after their respective clades |
age |
The age of the island, on the same scale as the branch lengths of the trees. If unspecified, the depth of the deepest stem across trees. |
tcols |
A vector of colonization times, with one value per clade. Order must be the same as in 'trees'. If unspecified, all clades are assigned the age of the island as colonization time. |
metadata |
Optional data frame with clade-level metadata. One column must be named "clade". |
mapping |
Optional aesthetic mapping to apply to the trees, as returned by the 'ggplot2::aes' function. Mapped variables can be anything in the columns of the 'data' node-wise data frame associated to the 'ggtree' plot being created (e.g. node, label, clade, mrca) or anything in the columns of the clade-wise 'metadata', if provided (in this case the aesthetics is mapped to all nodes within each clade). |
xlen |
Length of the extra tips grafted to each tree at the island age. These are a hack for scaling the plot. Keep this value small. |
pargs |
Optional arguments to be passed to 'geom_point' when plotting points at colonization events (e.g. size, shape...). |
bckgd |
Optional background color of the figure. This is because we use rectangles as a hack to hide tree branches prior to island colonization. Default to white background. |
A 'ggtree' plot, which is also a 'ggplot' object. The output is fully customizable, as any 'ggplot' object.
Raphael Scherrer (github.com/rscherrer)
# check whether package tibble has been installed if (!requireNamespace('tibble', quietly = TRUE)) { cat("Package tibble needed for this function to work. Please install it.") } else { set.seed(42) # Random trees t1 <- ape::rtree(10) t1$tip.label <- gsub("t", "t1.", t1$tip.label) t2 <- ape::rtree(3) t2$tip.label <- gsub("t", "t2.", t2$tip.label) t3 <- ape::rtree(2) trees <- list(t1, t2, t3) names(trees) <- c("A", "B", "C") # Toy colonization events for each clade tcols <- c(4.5, 5, 4.6) # Toy metadata metadata <- tibble::tibble( clade = names(trees), endemic = TRUE, # whether each clade is endemic uncertain = FALSE # whether colonization time is known for sure ) metadata$endemic[3] <- FALSE metadata$uncertain[2] <- TRUE # Island age age <- 5 # Make a plot p <- DAISIE_plot_input( trees, age, tcols, metadata, mapping = ggplot2::aes(color = endemic, linetype = uncertain), pargs = list(size = 3) ) p }
# check whether package tibble has been installed if (!requireNamespace('tibble', quietly = TRUE)) { cat("Package tibble needed for this function to work. Please install it.") } else { set.seed(42) # Random trees t1 <- ape::rtree(10) t1$tip.label <- gsub("t", "t1.", t1$tip.label) t2 <- ape::rtree(3) t2$tip.label <- gsub("t", "t2.", t2$tip.label) t3 <- ape::rtree(2) trees <- list(t1, t2, t3) names(trees) <- c("A", "B", "C") # Toy colonization events for each clade tcols <- c(4.5, 5, 4.6) # Toy metadata metadata <- tibble::tibble( clade = names(trees), endemic = TRUE, # whether each clade is endemic uncertain = FALSE # whether colonization time is known for sure ) metadata$endemic[3] <- FALSE metadata$uncertain[2] <- TRUE # Island age age <- 5 # Make a plot p <- DAISIE_plot_input( trees, age, tcols, metadata, mapping = ggplot2::aes(color = endemic, linetype = uncertain), pargs = list(size = 3) ) p }
Produces an image with the times of colonisation, branching times, clade name and clade status for all clades found in a given dataset.
DAISIE_plot_island(island, island_age = NA)
DAISIE_plot_island(island, island_age = NA)
island |
Island data object. Can be in DAISIE list format (see Galapagos_datalist and DAISIE_data_prep for examples) or in table format (see Galapagos_datatable for an example). |
island_age |
Age of island in appropriate units. In
|
R plot showing for each clade in the island object: time of colonisation, branching times, species status (endemic or non-endemic), total number of species in clade (n), number of species not sampled (m).
R plot.
Luis Valente
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr
,
DAISIE_sim_time_dep
,
DAISIE_sim_cr_shift
,
DAISIE_plot_age_diversity
### Plot Galapagos islands dataset from data table (specify island age) utils::data(Galapagos_datatable) DAISIE_plot_island(Galapagos_datatable, island_age=4) ### Plot Galapagos islands dataset from datalist (no need to specify ## island age) utils::data(Galapagos_datalist) DAISIE_plot_island(Galapagos_datalist)
### Plot Galapagos islands dataset from data table (specify island age) utils::data(Galapagos_datatable) DAISIE_plot_island(Galapagos_datatable, island_age=4) ### Plot Galapagos islands dataset from datalist (no need to specify ## island age) utils::data(Galapagos_datalist) DAISIE_plot_island(Galapagos_datalist)
Produces STT plots. If only one type of species is present in the simulated islands, STT is plotted for all species. If two types are present, three plots are produced: STT for all, STT for type 1 and STT for type 2.
R plots with number of total, endemic and non-endemic STTs for different types of species for the entire time span the islands were simulated. 2.5-97.5th percentiles are plotted in light grey, 25-75th percentiles plotted in dark grey.
DAISIE_plot_sims( island_replicates, plot_plus_one = TRUE, type = "all_species", sample_freq = 25, trait_pars = NULL )
DAISIE_plot_sims( island_replicates, plot_plus_one = TRUE, type = "all_species", sample_freq = 25, trait_pars = NULL )
island_replicates |
List output from
|
plot_plus_one |
Boolean to indicate to plot all values plus one.
Set to |
type |
String to indicate if stt of all species or all possible stt
should be plotted. Default is |
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. |
trait_pars |
A named list containing diversification rates considering
two trait states created by
|
R plot.
Luis Valente
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr
,
DAISIE_sim_time_dep
,
DAISIE_sim_cr_shift
, DAISIE_format_CS
### Plot islands with single process (only one type of species) utils::data(islands_1type_1000reps) DAISIE_plot_sims( island_replicates = islands_1type_1000reps ) ### Plot island with type 1 and type 2 utils::data(islands_2types_1000reps) DAISIE_plot_sims( island_replicates = islands_2types_1000reps )
### Plot islands with single process (only one type of species) utils::data(islands_1type_1000reps) DAISIE_plot_sims( island_replicates = islands_1type_1000reps ) ### Plot island with type 1 and type 2 utils::data(islands_2types_1000reps) DAISIE_plot_sims( island_replicates = islands_2types_1000reps )
This function calculates the joint distribution of the number of endemics and non-endemics for a given set of parameter values, a given mainland species pool size and a given set of times
DAISIE_probdist(pars1, pars2, tvec, initEI = c(0, 0), initprobs = NULL)
DAISIE_probdist(pars1, pars2, tvec, initEI = c(0, 0), initprobs = NULL)
pars1 |
Vector of model parameters: |
pars2 |
Vector of settings: |
tvec |
The times at which the probabilities need to be computed. |
initEI |
The initial values for the number of endemics and
non-endemics. In |
initprobs |
The initial probability distribution for the number of endemics and non-endemics; either this or initEI must be NULL. |
To obtain a matrix of probabilities with endemics in rows and non-endemics in columns for a certain time, one can run DAISIE_convertprobdist
A matrix of dimensions 1 + length(tvec) and pars[2]^2 + 1] where the first column contains the times at which the probabilities are evaluated and the other columns contain the joint probabilities.
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
### Compute the probability distribution at t = 4 and t = 8, for a mainland pool # size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting # from an empty island prob_dists <- DAISIE_probdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(0,0), initprobs = NULL )
### Compute the probability distribution at t = 4 and t = 8, for a mainland pool # size of 250 potential colonists and a vector of 5 parameters (cladogenesis, # extinction, clade-level carrying capacity, immigration, anagenesis) starting # from an empty island prob_dists <- DAISIE_probdist( pars1 = c(0.3,0.35,Inf,0.75,0.012), pars2 = c(100,250), tvec = c(4,8), initEI = c(0,0), initprobs = NULL )
This function simulates islands with given cladogenesis, extinction, Kprime, immigration and anagenesis parameters, all of which modelled as time-constant parameters. If a single parameter set is provided (5 parameters) it simulates islands where all species have the same macro-evolutionary process. If two paramater sets (10 parameters) are provided, it simulates islands where two different macro-evolutionary processes operate, one applying to type 1 species and other to type 2 species. Further, it allows for the simulation of non-oceanic islands, generating islands for which the starting condition includes potential endemic and non-endemic species.
DAISIE_sim_cr( time, M, pars, replicates, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, prop_type2_pool = NA, replicates_apply_type2 = TRUE, sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
DAISIE_sim_cr( time, M, pars, replicates, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, prop_type2_pool = NA, replicates_apply_type2 = TRUE, sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
divdepmodel |
Option divdepmodel = 'CS' runs a model with clade-specific carrying capacity, where diversity-dependence operates only within single clades, i.e. only among species originating from the same mainland colonist. Option divdepmodel = 'IW' runs a model with island-wide carrying capacity, where diversity-dependence operates within and among clades. Option divdepmodel = 'GW' runs a model with diversity-dependence operates within a guild. |
nonoceanic_pars |
A vector of length two with:
|
num_guilds |
The number of guilds on the mainland. The number of
mainland species is divided by the number of guilds when
|
prop_type2_pool |
Fraction of mainland species that belongs to the
second subset of species (type 2). Applies only when two types of species
are simulated (length(pars) = 10). For |
replicates_apply_type2 |
Applies only when two types of species are
being simulated. Default replicates_apply_type2 = TRUE runs simulations
until the number of islands where a type 2 species has colonised is equal
to the specified number of replicates. This is recommended if
|
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. |
plot_sims |
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
area_pars |
A named list containing area and sea level parameters as
created by
|
cond |
cond = 0 : conditioning on island age |
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. |
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. 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. It is only present if only 1 type of species is
simulated. Becomes $not_present_type1
: the number of mainland
lineages of type 1 that are not present on the island and
$not_present_type2
: the number of mainland lineages of type 2
that are not present on the island, if two types are simulated.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$stt_stt_type1
: STT table for type 1 species on the island -
only if 2 types of species were simulated (nI - number of non-endemic
species; nA - number of anagenetic species, nC - number of cladogenetic
species, present - number of independent colonisations present).
$stt_stt_type2
: STT table for type 2 species on the island
- only if 2 types of species were simulated (nI - number of non-endemic
species; nA - number of anagenetic species, nC - number of cladogenetic
species, present - number of independent colonisations present ).
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
Non_endemic_MaxAge
Endemic
Endemic&Non_Endemic
Non_endemic_MaxAge
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente, Albert Phillimore, Joshua Lambert, Shu Xie, Pedro Neves, Richèl J. C. Bilderbeek, Rampal Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_plot_sims()
for plotting STT of simulation
outputs.
Other simulation models:
DAISIE_sim_cr_shift()
,
DAISIE_sim_relaxed_rate()
,
DAISIE_sim_time_dep()
## Simulate 2 islands for 1 million years, where all species have equal ## rates. Pool size 100. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.05 ana_rate <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) set.seed(1) island_replicates <- DAISIE_sim_cr( time = 1, M = 100, pars = sim_pars, replicates = 2, plot_sims = FALSE, verbose = FALSE ) ## Simulate 2 islands for 1 million years with two types of species (type1 ## and type 2). Pool size 100 ## Fraction of type 2 species in source pool is 0.15. Function will ## simulate until number of islands where type 2 species has colonised is ## equal to number specified in replicates. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 sim_pars_type1 <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) sim_pars_type2 <- sim_pars_type1 * 2 set.seed(1) island_replicates_2types <- DAISIE_sim_cr( time = 1, M = 100, pars = c(sim_pars_type1, sim_pars_type2), replicates = 2, prop_type2_pool = 0.15, plot_sims = FALSE, verbose = FALSE ) ## Simulate two non-oceanic island for 1 million years. ## Pool size 500. Island area as a proportion ## of mainland is 0.1, proportion of native species is 0.9. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) set.seed(1) island_replicates <- DAISIE_sim_cr( time = 1, M = 500, pars = sim_pars, replicates = 2, nonoceanic_pars = c(0.1, 0.9), plot_sims = FALSE, verbose = FALSE ) ## Simulate 2 islands for 1 million years with a shift in immigration rate ## at 0.195 Ma, and plot the species-through-time plot. Pool size 296. pars_before_shift <- c(0.079, 0.973, Inf, 0.136, 0.413) pars_after_shift <- c(0.079, 0.973, Inf, 0.652, 0.413) tshift <- 0.195 set.seed(1) island_shift_replicates <- DAISIE_sim_cr_shift( time = 1, M = 296, pars = c(pars_before_shift, pars_after_shift), replicates = 2, shift_times = tshift, plot_sims = FALSE, verbose = FALSE )
## Simulate 2 islands for 1 million years, where all species have equal ## rates. Pool size 100. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.05 ana_rate <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) set.seed(1) island_replicates <- DAISIE_sim_cr( time = 1, M = 100, pars = sim_pars, replicates = 2, plot_sims = FALSE, verbose = FALSE ) ## Simulate 2 islands for 1 million years with two types of species (type1 ## and type 2). Pool size 100 ## Fraction of type 2 species in source pool is 0.15. Function will ## simulate until number of islands where type 2 species has colonised is ## equal to number specified in replicates. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 sim_pars_type1 <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) sim_pars_type2 <- sim_pars_type1 * 2 set.seed(1) island_replicates_2types <- DAISIE_sim_cr( time = 1, M = 100, pars = c(sim_pars_type1, sim_pars_type2), replicates = 2, prop_type2_pool = 0.15, plot_sims = FALSE, verbose = FALSE ) ## Simulate two non-oceanic island for 1 million years. ## Pool size 500. Island area as a proportion ## of mainland is 0.1, proportion of native species is 0.9. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate) set.seed(1) island_replicates <- DAISIE_sim_cr( time = 1, M = 500, pars = sim_pars, replicates = 2, nonoceanic_pars = c(0.1, 0.9), plot_sims = FALSE, verbose = FALSE ) ## Simulate 2 islands for 1 million years with a shift in immigration rate ## at 0.195 Ma, and plot the species-through-time plot. Pool size 296. pars_before_shift <- c(0.079, 0.973, Inf, 0.136, 0.413) pars_after_shift <- c(0.079, 0.973, Inf, 0.652, 0.413) tshift <- 0.195 set.seed(1) island_shift_replicates <- DAISIE_sim_cr_shift( time = 1, M = 296, pars = c(pars_before_shift, pars_after_shift), replicates = 2, shift_times = tshift, plot_sims = FALSE, verbose = FALSE )
Simulates island replicates with an clade-specific (CS) diversity-dependent constant-rate process
DAISIE_sim_cr_cs( total_time, M, pars, replicates, nonoceanic_pars, prop_type2_pool, replicates_apply_type2, sample_freq, hyper_pars, area_pars, cond, verbose )
DAISIE_sim_cr_cs( total_time, M, pars, replicates, nonoceanic_pars, prop_type2_pool, replicates_apply_type2, sample_freq, hyper_pars, area_pars, cond, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
nonoceanic_pars |
A vector of length two with:
|
prop_type2_pool |
Fraction of mainland species that belongs to the
second subset of species (type 2). Applies only when two types of species
are simulated (length(pars) = 10). For |
replicates_apply_type2 |
Applies only when two types of species are
being simulated. Default replicates_apply_type2 = TRUE runs simulations
until the number of islands where a type 2 species has colonised is equal
to the specified number of replicates. This is recommended if
|
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
|
area_pars |
A named list containing area and sea level parameters as
created by
|
cond |
cond = 0 : conditioning on island age |
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. |
A list. The highest level of the least corresponds to each individual replicate. See return for 'DAISIE_sim_cr()' for details.
Simulates island replicates with an guild-wide (GW) diversity-dependent process
DAISIE_sim_cr_gw( total_time, M, pars, replicates, nonoceanic_pars, num_guilds, sample_freq, hyper_pars, area_pars, verbose )
DAISIE_sim_cr_gw( total_time, M, pars, replicates, nonoceanic_pars, num_guilds, sample_freq, hyper_pars, area_pars, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
nonoceanic_pars |
A vector of length two with:
|
num_guilds |
The number of guilds on the mainland. The number of
mainland species is divided by the number of guilds when
|
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
|
area_pars |
A named list containing area and sea level parameters as
created by
|
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. |
A list. The highest level of the least corresponds to each individual replciate. See return for 'DAISIE_sim_cr()' for details.
Simulates island replicates with an island-wide (IW) diversity-dependent constant-rate process
DAISIE_sim_cr_iw( total_time, M, pars, replicates, nonoceanic_pars, sample_freq, hyper_pars, area_pars, cond, verbose )
DAISIE_sim_cr_iw( total_time, M, pars, replicates, nonoceanic_pars, sample_freq, hyper_pars, area_pars, cond, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
nonoceanic_pars |
A vector of length two with:
|
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
|
area_pars |
A named list containing area and sea level parameters as
created by
|
cond |
cond = 0 : conditioning on island age |
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. |
A list. The highest level of the least corresponds to each individual replicate. See return for 'DAISIE_sim_cr()' for details.
This function simulates islands with given cladogenesis, extinction, Kprime, immigration and anagenesis parameters, all of which modelled as time-constant parameters, which can be switched to a different diversification regime (i.e., different set of parameters) at one or more set times before the present. Further, it allows for the simulation of non-oceanic islands, generating islands for which the starting condition includes potential endemic and non-endemic species.
DAISIE_sim_cr_shift( time, M, pars, replicates, shift_times, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
DAISIE_sim_cr_shift( time, M, pars, replicates, shift_times, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
shift_times |
a numeric vector specifying when the rate shifts occur before the present. |
divdepmodel |
Option divdepmodel = 'CS' runs a model with clade-specific carrying capacity, where diversity-dependence operates only within single clades, i.e. only among species originating from the same mainland colonist. Option divdepmodel = 'IW' runs a model with island-wide carrying capacity, where diversity-dependence operates within and among clades. Option divdepmodel = 'GW' runs a model with diversity-dependence operates within a guild. |
nonoceanic_pars |
A vector of length two with:
|
num_guilds |
The number of guilds on the mainland. The number of
mainland species is divided by the number of guilds when
|
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. |
plot_sims |
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
area_pars |
A named list containing area and sea level parameters as
created by
|
cond |
cond = 0 : conditioning on island age |
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. |
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. The first element of each replicate is composed of island information containing:
$island_age
: A numeric with the island age.
$not_present
: A numeric with the number of mainland lineages
that are not present on the island.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
Non_endemic_MaxAge
Endemic
Endemic&Non_Endemic
Non_endemic_MaxAge
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente, Albert Phillimore, Torsten Hauffe
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
Hauffe, T., D. Delicado, R.S. Etienne and L. Valente (2020). Lake expansion elevates equilibrium diversity via increasing colonization.
DAISIE_plot_sims()
for plotting STT of simulation
outputs.
Other simulation models:
DAISIE_sim_relaxed_rate()
,
DAISIE_sim_time_dep()
,
DAISIE_sim()
This function simulates islands of given age, area and isolation. A list of islands/archipelagos with this information is provided as a data frame object (in the example, the archipelago_data from Valente et al 2020 Nature). For each island, local parameters are first calculated based on hyperparameters describing the dependency of rates on island area and isolation. Simulations are then run for each island, from island birth until the given island age based on the local parameters for each island (using the DAISIE_sim function).
Returns R list object that contains the simulated islands.
DAISIE_sim_MW( archipelago_data, M, pars, replicates, divdepmodel = "CS", distance_dep = "power", cladogenesis_dep = "NULL", sigmoidal_par = "NULL" )
DAISIE_sim_MW( archipelago_data, M, pars, replicates, divdepmodel = "CS", distance_dep = "power", cladogenesis_dep = "NULL", sigmoidal_par = "NULL" )
archipelago_data |
Object (data.frame) containing a table with columns with the following names: Archipelago: names of the archipelagos or islands to be simulated; Area - the area of the archipelago/island; Age: Age of the oldest island in the archipelago, or age of the island if single island. Distance - distance to the mainland (or other applicable isolation metric). As an example, the dataset from Valente et al 2020 for 41 archipelagos is provided in data(archipelago_data). |
M |
The size of the mainland pool, i.e the number of species that can potentially colonize the island(s). |
pars |
Contains the model hyperparameters:
|
replicates |
Number of island replicates to be simulated per island in the table archipelago_data. If there are 5 islands in archipelago_data, and number of replicates is set to 10, 50 islands will be simulated. |
divdepmodel |
Option divdepmodel = 'CS' runs model with clade-specific
carrying capacity, where diversity-dependence operates only within single
clades, i.e. only among species originating from the same mainland
colonist. |
distance_dep |
Shape of dependency of parameter with distance. Can be of type |
cladogenesis_dep |
When distance_dep = 'power' is specified, cladogenesis_dep specifies
the type of effect of area and isolation on cladogenesis. The possible options are:
|
sigmoidal_par |
When distance_dep = 'sigmoidal', sigmoidal_par specifies
to which parameter the sigmoidal relationship with distance is applied.
Options: |
For each island listed in the rows of archipelago_data, a given number of islands
is simulated depending on the number of replicates specified. The simulations for
each island in archipelago_data are an element of the list, which can be called using [[x]].
Individual replicates for an island can be called with [[x]][[x]]
For example if the object is called global_sims, the 1st replicate for the first island
can be called using global_sims[[1]][[1]].
The 3rd replicate of the 4th island is called with global_sims[[4]][[3]]
Each of the island replicates is a list in itself. The first (e.g.
global_sims[[x]][[x]][[1]]) element of that list has the following
components: $island_age
- the island or archipelago age $not_present
- the number of mainland lineages that are not present on the island $stt_all
- STT table for all species on the archipelago/island (nI - number of
non-endemic species; nA - number of anagenetic species, nC - number of
cladogenetic species, present - number of independent colonisations present)
$area
Area of the island or archipelago $distance
Distance to the mainland
$name
Name of the island or archipelago
The subsequent elements of the list each contain information on a single
colonist lineage on the island and has 4 components:$branching_times
- island age and stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge and Endemic with no close extant
relatives on the islands
species. For cladogenetic species these should be island age and branching
times of the radiation including the stem age of the radiation.$stac
- the status of the colonist
*
Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $missing_species
- number of island species that were not sampled for
particular clade (only applicable for endemic clades)
Luis Valente, Albert Phillimore, Rampal Etienne
Valente, LM, Phillimore AB, Melo M, Warren B, Clegg S, Havenstein K, Tiedemann R, Illera JC, Thebaud C, Aschenbach T and Etienne RS (2020). A simple dynamic model explain island bird diversity worldwide. Nature, 579, 92-96.
## Simulate 10 replicates for the each of the 41 archipelagos in the archipelago_data table, ##based on the hyperparameters of the M19 model (preferred model in Valente et al 2020) ## and the age, area and isolation values given in the archipelago_data table. ## Mainland pool size of 1000, clade-specific carrying capacity. The M19 model is a ## power model with an interactive effect of area and isolation on cladogenesis. ## ## data(archipelago_data) ## result <- DAISIE_sim_MW( ## archipelago_data = archipelago_data, ## M = 1000, ## pars = c(0.040073803, 0, 1.945656546, 0.150429656, Inf, 0, 67.25643672, ## 0.293635061, 0.059096872, 0.382688527, 0.026510781), ## replicates = 10, ## distance_dep = 'power', ## cladogenesis_dep = 'interactive', ## sigmoidal_par = 'NULL', ## divdepmodel = 'CS')
## Simulate 10 replicates for the each of the 41 archipelagos in the archipelago_data table, ##based on the hyperparameters of the M19 model (preferred model in Valente et al 2020) ## and the age, area and isolation values given in the archipelago_data table. ## Mainland pool size of 1000, clade-specific carrying capacity. The M19 model is a ## power model with an interactive effect of area and isolation on cladogenesis. ## ## data(archipelago_data) ## result <- DAISIE_sim_MW( ## archipelago_data = archipelago_data, ## M = 1000, ## pars = c(0.040073803, 0, 1.945656546, 0.150429656, Inf, 0, 67.25643672, ## 0.293635061, 0.059096872, 0.382688527, 0.026510781), ## replicates = 10, ## distance_dep = 'power', ## cladogenesis_dep = 'interactive', ## sigmoidal_par = 'NULL', ## divdepmodel = 'CS')
This function simulates islands with given cladogenesis, extinction, Kprime, immigration and anagenesis parameters, all of which can be modelled as time-constant parameters with variation between clades in one or multiple parameters. Further, it allows for the simulation of non-oceanic islands, generating islands for which the starting condition includes potential endemic and non-endemic species.
DAISIE_sim_relaxed_rate( time, M, pars, replicates, relaxed_par, nonoceanic_pars = c(0, 0), sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
DAISIE_sim_relaxed_rate( time, M, pars, replicates, relaxed_par, nonoceanic_pars = c(0, 0), sample_freq = 25, plot_sims = TRUE, hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), cond = 0, verbose = TRUE, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
relaxed_par |
A string determining which parameter is relaxed in a relaxed rate model. |
nonoceanic_pars |
A vector of length two with:
|
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. |
plot_sims |
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
area_pars |
A named list containing area and sea level parameters as
created by
|
cond |
cond = 0 : conditioning on island age |
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. |
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. 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. It is only present if only 1 type of species is
simulated. Becomes $not_present_type1
: the number of mainland
lineages of type 1 that are not present on the island and
$not_present_type2
: the number of mainland lineages of type 2
that are not present on the island, if two types are simulated.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$stt_stt_type1
: STT table for type 1 species on the island -
only if 2 types of species were simulated (nI - number of non-endemic
species; nA - number of anagenetic species, nC - number of cladogenetic
species, present - number of independent colonisations present).
$stt_stt_type2
: STT table for type 2 species on the island
- only if 2 types of species were simulated (nI - number of non-endemic
species; nA - number of anagenetic species, nC - number of cladogenetic
species, present - number of independent colonisations present ).
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
Non_endemic_MaxAge
Endemic
Endemic&Non_Endemic
Non_endemic_MaxAge
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente, Albert Phillimore, Joshua Lambert, Shu Xie, Pedro Neves, Richèl J. C. Bilderbeek, Rampal Etienne
DAISIE_plot_sims()
for plotting STT of simulation
outputs.
Other simulation models:
DAISIE_sim_cr_shift()
,
DAISIE_sim_time_dep()
,
DAISIE_sim()
## Simulate an island for 1 million years, with a relaxed the rate of ## cladogenesis between clades. Pool size 500. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 par_sd <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate, par_sd) set.seed(1) island_replicates <- DAISIE_sim_relaxed_rate( time = 1, M = 500, pars = sim_pars, replicates = 2, relaxed_par = "cladogenesis", plot_sims = FALSE, verbose = FALSE )
## Simulate an island for 1 million years, with a relaxed the rate of ## cladogenesis between clades. Pool size 500. clado_rate <- 0.5 ext_rate <- 0.2 carr_cap <- Inf immig_rate <- 0.005 ana_rate <- 1 par_sd <- 1 sim_pars <- c(clado_rate, ext_rate, carr_cap, immig_rate, ana_rate, par_sd) set.seed(1) island_replicates <- DAISIE_sim_relaxed_rate( time = 1, M = 500, pars = sim_pars, replicates = 2, relaxed_par = "cladogenesis", plot_sims = FALSE, verbose = FALSE )
This function simulates islands with given cladogenesis, extinction, Kprime, immigration and anagenesis parameters, all of which modelled as time-dependent parameters.
Time dependency aims to capture the
effect of area changes islands undego from their emergence until subsidence.
Thus, oceanic, volcanic island ontogeny scenarios can be modelled (by a
beta function), as well as the effect of sea level fluctuations (modelled
through a sine function). See paramter entry area_pars
for details.
Both island ontogeny and sea level fluctuations are allowed to operate
simultaneuosly.
This function also allows for the simulation of non-oceanic islands, generating islands for which the starting condition includes potential endemic and non-endemic species.
DAISIE_sim_time_dep( time, M, pars, replicates, area_pars, hyper_pars, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", extcutoff = 1000, cond = 0, verbose = TRUE, ... )
DAISIE_sim_time_dep( time, M, pars, replicates, area_pars, hyper_pars, divdepmodel = "CS", nonoceanic_pars = c(0, 0), num_guilds = NULL, sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", extcutoff = 1000, cond = 0, verbose = TRUE, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
area_pars |
A named list containing area and sea level parameters as
created by
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
divdepmodel |
Option divdepmodel = 'CS' runs a model with clade-specific carrying capacity, where diversity-dependence operates only within single clades, i.e. only among species originating from the same mainland colonist. Option divdepmodel = 'IW' runs a model with island-wide carrying capacity, where diversity-dependence operates within and among clades. Option divdepmodel = 'GW' runs a model with diversity-dependence operates within a guild. |
nonoceanic_pars |
A vector of length two with:
|
num_guilds |
The number of guilds on the mainland. The number of
mainland species is divided by the number of guilds when
|
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. |
plot_sims |
|
island_ontogeny |
In |
sea_level |
In |
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
cond |
cond = 0 : conditioning on island age |
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. |
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. The first element of each replicate is composed of island information containing:
$island_age
: A numeric with the island age.
$not_present
: A numeric with the number of mainland lineages
that are not present on the island.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
Non_endemic_MaxAge
Endemic
Endemic&Non_Endemic
Non_endemic_MaxAge
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente and Albert Phillimore
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
Valente, L.M., Etienne, R.S. and Phillimore, A.B. (2014). The effects of island ontogeny on species diversity and phylogeny. Proceedings of the Royal Society B: Biological Sciences 281(1784), p.20133227.
DAISIE_plot_sims()
for plotting STT of simulation
outputs.
Other simulation models:
DAISIE_sim_cr_shift()
,
DAISIE_sim_relaxed_rate()
,
DAISIE_sim()
Simulates island replicates with an clade-specific (CS) diversity-dependent time-dependent process
DAISIE_sim_time_dep_cs( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, cond, verbose )
DAISIE_sim_time_dep_cs( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, cond, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
area_pars |
A named list containing area and sea level parameters as
created by
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
nonoceanic_pars |
A vector of length two with:
|
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. |
island_ontogeny |
In |
sea_level |
In |
peak |
A numeric value specifying the peakiness (or shaprness) of the
ontogeny curve. Higher values imply peakier ontogeny. This value is
internally calculated by |
Amax |
A numeric value for maximum island area during the simulation. |
Amin |
A numeric value for minimum island area during the simulation. |
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
cond |
cond = 0 : conditioning on island age |
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. |
A list. The highest level of the least corresponds to each individual replicate. See return for 'DAISIE_sim_time_dep()' for details.
Simulates island replicates with an guild-wide (GW) diversity-dependent time-dependent process
DAISIE_sim_time_dep_gw( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, num_guilds, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, verbose )
DAISIE_sim_time_dep_gw( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, num_guilds, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
area_pars |
A named list containing area and sea level parameters as
created by
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
nonoceanic_pars |
A vector of length two with:
|
num_guilds |
The number of guilds on the mainland. The number of
mainland species is divided by the number of guilds when
|
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. |
island_ontogeny |
In |
sea_level |
In |
peak |
A numeric value specifying the peakiness (or shaprness) of the
ontogeny curve. Higher values imply peakier ontogeny. This value is
internally calculated by |
Amax |
A numeric value for maximum island area during the simulation. |
Amin |
A numeric value for minimum island area during the simulation. |
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
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. |
A list. The highest level of the least corresponds to each individual replicate. See return for 'DAISIE_sim_time_dep()' for details.
Simulates island replicates with an island-wide (IW) diversity-dependent time-dependent process
DAISIE_sim_time_dep_iw( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, cond, verbose )
DAISIE_sim_time_dep_iw( total_time, M, pars, replicates, area_pars, hyper_pars, nonoceanic_pars, sample_freq, island_ontogeny, sea_level, peak, Amax, Amin, extcutoff, cond, verbose )
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
area_pars |
A named list containing area and sea level parameters as
created by
|
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
nonoceanic_pars |
A vector of length two with:
|
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. |
island_ontogeny |
In |
sea_level |
In |
peak |
A numeric value specifying the peakiness (or shaprness) of the
ontogeny curve. Higher values imply peakier ontogeny. This value is
internally calculated by |
Amax |
A numeric value for maximum island area during the simulation. |
Amin |
A numeric value for minimum island area during the simulation. |
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
cond |
cond = 0 : conditioning on island age |
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. |
A list. The highest level of the least corresponds to each individual replicate. See return for 'DAISIE_sim_time_dep()' for details.
This function simulates islands with given cladogenesis, extinction, K, immigration and anagenesis parameters for binary states.
Returns R list object that contains the simulated islands
DAISIE_sim_trait_dep( time, M, pars, replicates, divdepmodel = "CS", sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), extcutoff = 1000, cond = 0, verbose = TRUE, trait_pars = NULL, ... )
DAISIE_sim_trait_dep( time, M, pars, replicates, divdepmodel = "CS", sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), extcutoff = 1000, cond = 0, verbose = TRUE, trait_pars = NULL, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
divdepmodel |
Option divdepmodel = 'CS' runs a model with clade-specific carrying capacity, where diversity-dependence operates only within single clades, i.e. only among species originating from the same mainland colonist. Option divdepmodel = 'IW' runs a model with island-wide carrying capacity, where diversity-dependence operates within and among clades. Option divdepmodel = 'GW' runs a model with diversity-dependence operates within a guild. |
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. |
plot_sims |
|
island_ontogeny |
In |
sea_level |
In |
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
area_pars |
A named list containing area and sea level parameters as
created by
|
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
cond |
cond = 0 : conditioning on island age |
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. |
trait_pars |
A named list containing diversification rates considering
two trait states created by
|
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. The first element of each replicate is composed of island information containing:
$island_age
: A numeric with the island age.
$not_present
: A numeric with the number of mainland lineages
that are not present on the island.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente and Albert Phillimore
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852. Hauffe, T., D. Delicado, R.S. Etienne and L. Valente (submitted). Lake expansion increases equilibrium diversity via the target effect of island biogeography.
DAISIE_format_CS
DAISIE_plot_sims
This function simulates islands with given cladogenesis, extinction, K, immigration and anagenesis parameters. In this version, rates and K are both trait-dependent.
Returns R list object that contains the simulated islands
DAISIE_sim_trait_dep_2K( time, M, pars, replicates, divdepmodel = "CS", sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), extcutoff = 1000, cond = 0, verbose = TRUE, trait_pars = NULL, ... )
DAISIE_sim_trait_dep_2K( time, M, pars, replicates, divdepmodel = "CS", sample_freq = 25, plot_sims = TRUE, island_ontogeny = "const", sea_level = "const", hyper_pars = create_hyper_pars(d = 0, x = 0), area_pars = DAISIE::create_area_pars(max_area = 1, current_area = 1, proportional_peak_t = 0, total_island_age = 0, sea_level_amplitude = 0, sea_level_frequency = 0, island_gradient_angle = 0), extcutoff = 1000, cond = 0, verbose = TRUE, trait_pars = NULL, ... )
time |
Numeric defining the length of the simulation in time units. For example, if an island is known to be 4 million years old, setting time = 4 will simulate the entire life span of the island; setting time = 2 will stop the simulation at the mid-life of the island. |
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:
Elements 6:10 are required only when type 2 species are included
or in the rate shift model. For |
replicates |
Integer specifying number of island replicates to be simulated. |
divdepmodel |
Option divdepmodel = 'CS' runs a model with clade-specific carrying capacity, where diversity-dependence operates only within single clades, i.e. only among species originating from the same mainland colonist. Option divdepmodel = 'IW' runs a model with island-wide carrying capacity, where diversity-dependence operates within and among clades. Option divdepmodel = 'GW' runs a model with diversity-dependence operates within a guild. |
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. |
plot_sims |
|
island_ontogeny |
In |
sea_level |
In |
hyper_pars |
A named list of numeric hyperparameters for the rate
calculations as returned by
|
area_pars |
A named list containing area and sea level parameters as
created by
|
extcutoff |
A numeric with the cutoff for the the maximum extinction rate preventing it from being too large and slowing down simulation. |
cond |
cond = 0 : conditioning on island age |
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. |
trait_pars |
A named list containing diversification rates considering
two trait states created by
|
... |
Any arguments to pass on to plotting functions. |
A list. The highest level of the least corresponds to each individual replciate. The first element of each replicate is composed of island information containing:
$island_age
: A numeric with the island age.
$not_present
: A numeric with the number of mainland lineages
that are not present on the island.
$stt_all
: STT table for all species on the island
(nI - number of non-endemic species; nA - number of anagenetic species,
nC - number of cladogenetic species, present - number of independent
colonisations present)
$brts_table
: Only for simulations under "IW"
. Table
containing information on order of events in the data, for use in maximum
likelihood optimization.).
The subsequent elements of the list pertaining to each replcate contain information on a single colonist lineage on the island and have 4 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 4
indicating the status of the colonist:
$missing_species
: number of island species that were
not sampled for particular clade (only applicable for endemic clades)
$type_1or2
: whether the colonist belongs to type 1 or type 2
Luis Valente and Albert Phillimore
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852. Hauffe, T., D. Delicado, R.S. Etienne and L. Valente (submitted). Lake expansion increases equilibrium diversity via the target effect of island biogeography.
DAISIE_format_CS
DAISIE_plot_sims
Computes the loglikelihood of the DAISIE model with clade-specific diversity-dependence given colonization and branching times for lineages on an island, and a set of model parameters that may shift at some time
DAISIE_SR_loglik_CS( pars1, pars2, datalist, methode = "lsodes", CS_version = 1, abstolint = 1e-16, reltolint = 1e-10 )
DAISIE_SR_loglik_CS( pars1, pars2, datalist, methode = "lsodes", CS_version = 1, abstolint = 1e-16, reltolint = 1e-10 )
pars1 |
Contains the model parameters: |
pars2 |
Contains the model settings |
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object, but
the object can of course also be entered directly. It is an R list object
with the following elements. |
methode |
Method of the ODE-solver. See package deSolve for details. Default is "lsodes" |
CS_version |
a numeric or list. Default is 1 for the standard DAISIE model, for a relaxed-rate model a list with the following elements:
|
abstolint |
Absolute tolerance of the integration |
reltolint |
Relative tolerance of the integration |
The output is a loglikelihood value
The loglikelihood
Rampal S. Etienne & Bart Haegeman
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
utils::data(Galapagos_datalist_2types) pars1 = c(0.195442017,0.087959583,Inf,0.002247364,0.873605049, 3755.202241,8.909285094,14.99999923,0.002247364,0.873605049,0.163) pars2 = c(100,11,0,1) DAISIE_loglik_all(pars1,pars2,Galapagos_datalist_2types)
utils::data(Galapagos_datalist_2types) pars1 = c(0.195442017,0.087959583,Inf,0.002247364,0.873605049, 3755.202241,8.909285094,14.99999923,0.002247364,0.873605049,0.163) pars2 = c(100,11,0,1) DAISIE_loglik_all(pars1,pars2,Galapagos_datalist_2types)
This function computes the maximum likelihood estimates of the parameters of the DAISIE model with clade-specific diversity-dependence and a shift in parameters for data from lineages colonizing an island. It also outputs the corresponding loglikelihood that can be used in model comparisons.
The result of sort(c(idparsopt, idparsfix, idparsnoshift)) should be
identical to c(1:10). If not, an error is reported that the input is
incoherent. The same happens when the length of initparsopt is different
from the length of idparsopt, and the length of parsfix is different from
the length of idparsfix.
Including the 11th parameter (p_f) in either
idparsopt or idparsfix (and therefore initparsopt or parsfix) is optional.
If this parameter is not specified, then the information in the data is
used, otherwise the information in the data is overruled.
DAISIE_SR_ML_CS( datalist, initparsopt, idparsopt, parsfix, idparsfix, idparsnoshift = 6:10, res = 100, ddmodel = 0, cond = 0, island_ontogeny = NA, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), jitter = 0, num_cycles = 1 )
DAISIE_SR_ML_CS( datalist, initparsopt, idparsopt, parsfix, idparsfix, idparsnoshift = 6:10, res = 100, ddmodel = 0, cond = 0, island_ontogeny = NA, tol = c(1e-04, 1e-05, 1e-07), maxiter = 1000 * round((1.25)^length(idparsopt)), methode = "lsodes", optimmethod = "subplex", CS_version = 1, verbose = 0, tolint = c(1e-16, 1e-10), jitter = 0, num_cycles = 1 )
datalist |
Data object containing information on colonisation and
branching times. This object can be generated using the DAISIE_dataprep
function, which converts a user-specified data table into a data object, but
the object can of course also be entered directly. It is an R list object
with the following elements. |
initparsopt |
The initial values of the parameters that must be optimized |
idparsopt |
The ids of the parameters that must be optimized. The ids
are defined as follows: |
parsfix |
The values of the parameters that should not be optimized |
idparsfix |
The ids of the parameters that should not be optimized, e.g. c(1,3) if lambda^c and K should not be optimized. |
idparsnoshift |
The ids of the parameters that should not be different before and after the shift. |
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: |
cond |
cond = 0 : conditioning on island age |
island_ontogeny |
type of island ontonogeny. If NA, then constant ontogeny is assumed. |
tol |
Sets the tolerances in the optimization. Consists of: |
maxiter |
Sets the maximum number of iterations in the optimization. |
methode |
Method of the ODE-solver. See package deSolve for details. Default is "lsodes" |
optimmethod |
Method used in likelihood optimization. Default is "subplex" (see subplex package). Alternative is 'simplex' which was the method in previous versions. |
CS_version |
a numeric or list. Default is 1 for the standard DAISIE model, for a relaxed-rate model a list with the following elements:
|
verbose |
sets whether parameters and likelihood should be printed (1) or not (0). |
tolint |
Vector of two elements containing the absolute and relative tolerance of the integration. |
jitter |
Numeric for |
num_cycles |
The number of cycles the optimizer will go through. Default is 1. |
The output is a dataframe containing estimated parameters and maximum loglikelihood.
lambda_c |
gives the maximum likelihood estimate of lambda^c, the rate of cladogenesis |
mu |
gives the maximum likelihood estimate of mu, the extinction rate |
K |
gives the maximum likelihood estimate of K, the carrying-capacity |
gamma |
gives the maximum likelihood estimate of gamma, the immigration rate |
lambda_a |
gives the maximum likelihood estimate of lambda^a, the rate of anagenesis |
lambda_c2 |
gives the maximum likelihood estimate of lambda^c2, the rate of cladogenesis for the optional second group of species |
mu2 |
gives the maximum likelihood estimate of mu2, the extinction rate for the optional second group of species |
K2 |
gives the maximum likelihood estimate of K2, the carrying-capacity for the optional second group of species |
gamma2 |
gives the maximum likelihood estimate of gamma2, the immigration rate for the optional second group of species |
lambda_a2 |
gives the maximum likelihood estimate of lambda^a2, the rate of anagenesis for the optional second group of species |
loglik |
gives the maximum loglikelihood |
df |
gives the number of estimated parameters, i.e. degrees of feedom |
conv |
gives a message on convergence of optimization; conv = 0 means convergence |
Rampal S. Etienne
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852. <DOI:10.1111/ele.12461>.
DAISIE_loglik_all()
,
DAISIE_sim_cr
## In all following DAISIE_ML calls very high tolerances and low system size ## are used for fast computation for this example. Use default or better ## tol, tolint an res values in actual analyses. ################## ### When all species have the same rates, and we want to optimize all 5 ### parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,20,0.009,1.01), ddmodel = 11, idparsopt = 1:5, parsfix = NULL, idparsfix = NULL, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates, and we want to optimize all parameters # except K (which we set equal to Inf), we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,0.009,1.01), idparsopt = c(1,2,4,5), parsfix = Inf, idparsfix = 3, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, and we want to optimize all parameters except K (which we # set equal to Inf), fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(0.38,0.55,0.004,1.1,2.28), idparsopt = c(1,2,4,5,6), parsfix = c(Inf,Inf,0.163), idparsfix = c(3,8,11), idparsnoshift = c(7,9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, extinction and a different K, and we want to optimize all # parameters, fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, ddmodel = 11, initparsopt = c(0.19,0.09,0.002,0.87,20,8.9,15), idparsopt = c(1,2,4,5,6,7,8), parsfix = c(Inf,0.163), idparsfix = c(3,11), idparsnoshift = c(9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of extinction, and we want to optimize all parameters except K (which we # set equal to Inf), and we also# want to estimate the fraction of finch species # in the mainland pool. we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(2.48,2.7,0.009,1.01,2.25,0.163), idparsopt = c(1,2,4,5,7,11), parsfix = c(Inf,Inf), idparsfix = c(3,8), idparsnoshift = c(6,9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When we have two islands with the same rates except for immigration and anagenesis rate, # and we want to optimize all parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = list(Galapagos_datalist,Galapagos_datalist), datatype = 'multiple', initparsopt = c(2.5,2.7,20,0.009,1.01,0.009,1.01), idparsmat = rbind(1:5,c(1:3,6,7)), idparsopt = 1:7, parsfix = NULL, idparsfix = NULL, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When we consider the four Macaronesia archipelagoes and set all parameters the same # except for rates of cladogenesis, extinction and immigration for Canary Islands, # rate of cladogenesis is fixed to 0 for the other archipelagoes, # diversity-dependence is assumed to be absent # and we want to optimize all parameters, we use: utils::data(Macaronesia_datalist) DAISIE_ML( datalist = Macaronesia_datalist, datatype = 'multiple', initparsopt = c(1.053151832,0.052148979,0.512939011,0.133766934,0.152763179), idparsmat = rbind(1:5,c(6,2,3,7,5),1:5,1:5), idparsopt = c(2,4,5,6,7), parsfix = c(0,Inf), idparsfix = c(1,3), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 )
## In all following DAISIE_ML calls very high tolerances and low system size ## are used for fast computation for this example. Use default or better ## tol, tolint an res values in actual analyses. ################## ### When all species have the same rates, and we want to optimize all 5 ### parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,20,0.009,1.01), ddmodel = 11, idparsopt = 1:5, parsfix = NULL, idparsfix = NULL, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates, and we want to optimize all parameters # except K (which we set equal to Inf), we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = Galapagos_datalist, initparsopt = c(2.5,2.7,0.009,1.01), idparsopt = c(1,2,4,5), parsfix = Inf, idparsfix = 3, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, and we want to optimize all parameters except K (which we # set equal to Inf), fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(0.38,0.55,0.004,1.1,2.28), idparsopt = c(1,2,4,5,6), parsfix = c(Inf,Inf,0.163), idparsfix = c(3,8,11), idparsnoshift = c(7,9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of cladogenesis, extinction and a different K, and we want to optimize all # parameters, fixing the proportion of finch-type species at 0.163, we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, ddmodel = 11, initparsopt = c(0.19,0.09,0.002,0.87,20,8.9,15), idparsopt = c(1,2,4,5,6,7,8), parsfix = c(Inf,0.163), idparsfix = c(3,11), idparsnoshift = c(9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When all species have the same rates except that the finches have a different # rate of extinction, and we want to optimize all parameters except K (which we # set equal to Inf), and we also# want to estimate the fraction of finch species # in the mainland pool. we use: utils::data(Galapagos_datalist_2types) DAISIE_ML( datalist = Galapagos_datalist_2types, initparsopt = c(2.48,2.7,0.009,1.01,2.25,0.163), idparsopt = c(1,2,4,5,7,11), parsfix = c(Inf,Inf), idparsfix = c(3,8), idparsnoshift = c(6,9,10), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When we have two islands with the same rates except for immigration and anagenesis rate, # and we want to optimize all parameters, we use: utils::data(Galapagos_datalist) DAISIE_ML( datalist = list(Galapagos_datalist,Galapagos_datalist), datatype = 'multiple', initparsopt = c(2.5,2.7,20,0.009,1.01,0.009,1.01), idparsmat = rbind(1:5,c(1:3,6,7)), idparsopt = 1:7, parsfix = NULL, idparsfix = NULL, tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 ) ### When we consider the four Macaronesia archipelagoes and set all parameters the same # except for rates of cladogenesis, extinction and immigration for Canary Islands, # rate of cladogenesis is fixed to 0 for the other archipelagoes, # diversity-dependence is assumed to be absent # and we want to optimize all parameters, we use: utils::data(Macaronesia_datalist) DAISIE_ML( datalist = Macaronesia_datalist, datatype = 'multiple', initparsopt = c(1.053151832,0.052148979,0.512939011,0.133766934,0.152763179), idparsmat = rbind(1:5,c(6,2,3,7,5),1:5,1:5), idparsopt = c(2,4,5,6,7), parsfix = c(0,Inf), idparsfix = c(1,3), tol = c(0.1, 0.02, 0.01), tolint = c(1e-4, 1e-2), res = 50 )
A list containing the colonization and branching times of the Eleutherodactylus frogs of
Hispaniola. Main dataset used in Etienne et al. This list can be generated
using the DAISIE_dataprep function, which converts a user-specified data table into a data object,
but the
object can of course also be entered directly. It is an R list object with
the following elements.
The first element of the list has two
components: $island_age
- the island age $not_present
- the number of mainland lineages that are not present
on the island
The following elements of the list each contains
information on a single colonist lineage on the island and has 5
components:$colonist_name
- the name of the species or clade
that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island clade including the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4
* Endemic_MaxAge: 5 or 6 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset all are equal to 1.
A list with 6 elements, the first of which contains 2 elements and the following 5 elements containing 5 components.
Etienne RS, Haegeman B, Dugo-Cota A, Vila C, Gonzalez-Voyer A & Valente L. The
limits to ecological limits to diversification.
DAISIE_dataprep
, DAISIE_ML
, DAISIE_SR_ML
A table containing the colonization and branching times of the Eleutherodacytlus
frogs of the island of Hispaniola (Greater Antilles). Each row on the table represents and independent
colonisation event. The table has four columns. $Clade_name
-
name of independent colonization event $Status
- One of the
following categories:
* Non_endemic: for non-endemic island species when an approximate time of colonisation is known
* Non_endemic_MaxAge: for non-endemic island species when colonisation time is unknown
* Endemic: for endemic species when an approximate colonisation time is known
* "Endemic_MaxAge": applies to endemic species or endemic clades for cases where the
colonisation time is unknown, or when
the user wants to specify an upper bound for colonisation.
This could for example apply to endemic species that have recently gone extinct because
of anthropogenic causes, and which are not included
in the phylogeny ("NA" should be given in the branching times column). It
could also apply to insular radiations with long stem branches, for which the
time of the first cladogenetic event is known, but the precise time of colonisation
is not.
* Endemic&Non_Endemic: when endemic clade and mainland ancestor has
re-colonized
A table with 5 rows and 4 columns.
Etienne RS, Haegeman B, Dugo-Cota A, Vila C, Gonzalez-Voyer A & Valente L. The
limits to ecological limits to diversification.
A list containing the colonization and branching times of the terrestrial
avifauna in the Galapagos where no distinction is made between types of
colonists. This list can be generated using the DAISIE_dataprep function,
which converts a user-specified data table into a data object, but the
object can of course also be entered directly. It is an R list object with
the following elements.
The first element of the list has two
components: $island_age
- the island age $not_present
- the number of mainland lineages that are not present
on the island
The following 8 elements of the list each contains
information on a single colonist lineage on the island and has 5
components:$colonist_name
- the name of the species or clade
that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island cladeincluding the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset all are equal to 1.
A list with 9 elements the first of which contains 2 elements and the following 8 containing 5 components.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
A list containing the colonization and branching times of the terrestrial
avifauna in the Galapagos. This list can be generated using the
DAISIE_dataprep function, which converts a user-specified data table into a
data object, but the object can of course also be entered directly. It is an
R list object with the following elements.
The first element of the
list has three components: $island_age
- the island age $not_present_type1
- the number of mainland lineages of type 1 that
are not present on the island $not_present_type2
- the number of
mainland lineages of type 2 that are not present on the island
The
following 8 elements of the list each contains information on a single
colonist lineage on the island and has 5 components:$colonist_name
- the name of the species or clade that colonized the
island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close relatives
on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island cladeincluding the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset only the finches are type 2
A list with 9 elements the first of which contains 3 elements and the following 8 containing 5 components.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
A table containing the colonization and branching times of the terrestrial
avifauna in the Galápagos. Each row on the table represents and independent
colonisation event. The table has four columns. $Clade_name
-
name of independent colonization event $Status
- One of the
following categories:
* Non_endemic: for non-endemic island species when an approximate time of colonisation is known
* Non_endemic_MaxAge: for non-endemic island species when colonisation time is unknown
* Endemic: for endemic species when an approximate colonisation time is known
* "Endemic_MaxAge": applies to endemic species or endemic clades for cases where the
colonisation time is unknown, or when
the user wants to specify an upper bound for colonisation.
This could for example apply to endemic species that have recently gone extinct because
of anthropogenic causes, and which are not included
in the phylogeny ("NA" should be given in the branching times column). It
could also apply to insular radiations with long stem branches, for which the
time of the first cladogenetic event is known, but the precise time of colonisation
is not.
* Endemic&Non_Endemic: when endemic clade and mainland ancestor has
re-colonized
$Missing_species
- Number of island species that
were not sampled for particular clade (only applicable for endemic clades)$Branching_times
- Stem age of the population/species in the case of "Non_endemic",
"Non_endemic_MaxAge" and "Endemic" species with no extant close relatives on the island.
Set "NA" if colonisation time unknown and no upper bound is known.
For "Endemic" cladogenetic species these should be branching times of the
radiation, including the stem age of the radiation (colonisation time estimate).
A table with 8 rows and 4 columns.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
Each simulated dataset is an element of the list, which can be called using
e.g. islands_10reps_RAW[[1]] Each of the island replicates is a list in
itself. The first (e.g. islands_10reps_RAW[[x]][[1]]) element of that list
has the following components:
The following elements of the RAW list
each contain information on a single colonist lineage on the island and has
5 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
- the status of the colonist
* Not_present: 0
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $stt_table
- Species-through-time table for
the descendants of the mainland species (nI - number of non-endemic species;
nA - number of anagenetic species, nC - number of cladogenetic species)$missing_species
- number of island species that were not sampled for
particular clade (only applicable for endemic clades)
A list with 10 items.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr()
, DAISIE_plot_sims
Each simulated dataset is an element of the list, which can be called using
e.g. islands_1type_1000reps[[1]] Each of the island replicates is a list in
itself. The first (e.g. islands_1type_1000reps[[x]][[1]]) element of that
list has the following components: $island_age
- the island age$not_present
- the number of mainland lineages that are not
present on the island $stt_all
- STT table for all species on the
island (nI - number of non-endemic species; nA - number of anagenetic
species, nC - number of cladogenetic species, present - number of
independent colonisations present )
The subsequent elements of the list each contain information on a single
colonist lineage on the island and has 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
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $missing_species
- number of island species that were not sampled for
particular clade (only applicable for endemic clades)
A list with 1000 items.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr()
, DAISIE_plot_sims
Each simulated dataset is an element of the list, which can be called using
e.g. islands_2types_1000reps[[1]] Each of the island replicates is a list in
itself. The first (e.g. islands_2types_1000reps[[x]][[1]]) element of that
list has the following components: $island_age
- the island age$not_present_type1
- the number of mainland lineages of type 1
that are not present on the island $not_present_type2
- the
number of mainland lineages of type 2 that are not present on the island $stt_all
- STT table for all species on the island (nI - number of
non-endemic species; nA - number of anagenetic species, nC - number of
cladogenetic species, present - number of independent colonisations present
)$stt_stt_type1
- STT table for type 1 species on the island (nI
- number of non-endemic species; nA - number of anagenetic species, nC -
number of cladogenetic species, present - number of independent
colonisations present )$stt_stt_type2
- STT table for type 2
species on the island (nI - number of non-endemic species; nA - number of
anagenetic species, nC - number of cladogenetic species, present - number of
independent colonisations present )
The subsequent elements of the list each contain information on a single
colonist lineage on the island and has 4 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
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4 $missing_species
- number of island species that were not sampled for
particular clade (only applicable for endemic clades) $type_1or2
- whether the colonist belongs to type 1 or type 2
A list with 1000 items.
Valente, L.M., A.B. Phillimore and R.S. Etienne (2015). Equilibrium and non-equilibrium dynamics simultaneously operate in the Galapagos islands. Ecology Letters 18: 844-852.
DAISIE_sim_cr()
, DAISIE_plot_sims
A list containing the colonization and branching times of the terrestrial
avifauna in 4 archipelagos: Azores, Canary Islands, Cape Verde and Madeira.
It is an R list object with the 4 main elements corresponding to each of the
archipelagos (e.g. Macaronesia_datalist[[1]] calls the Azores data). Each of
the four elements is then made of several elemants:
The first element of the list for an archipelago has two components: $island_age
- the island age $not_present
- the number of
mainland lineages that are not present on the island
The following elements of the list each contains information on a single colonist lineage
on the island and has 5 components:$colonist_name
- the name
of the species or clade that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island clade including the stem age of the clade.
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4
* Endemic_MaxAge: 5 $missing_species
- number of island species that were not sampled for
particular clade (only applicable for endemic clades) $type1or2
-
whether the colonist belongs to type 1 or type 2. In this dataset all are
equal to 1.
A list with 4 main elements for each archipelago. Each element has several sub-elements.
Valente L., Illera J.C, Havenstein K., Pallien T., Etienne R.S., Tiedemann R. Equilibrium bird species diversity in Atlantic islands. 2017 Current Biology, 27, 1660-1666.
A list containing the colonization and branching times of the birds of
New Zealand. Main dataset used in
Valente, Etienne, Garcia-R (2019) Current Biology. Island age 52 Myr and mainland
pool size of 1000 species.
The first element of the list has two
components: $island_age
- the island age $not_present
- the number of mainland lineages that are not present
on the island
The following elements of the list each contain
information on a single colonist lineage on the island and has 5
components:$colonist_name
- the name of the species or clade
that colonized the island $branching_times
- island age followed by stem age of the population/species
in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close
relatives on the island. For endemic clades with more than one species on the island
(cladogenetic clades/ radiations) these should be island age followed by the
branching times of the island clade including the stem age of the clade.$stac
- the status of the colonist
* Non_endemic_MaxAge: 1
* Endemic: 2
* Endemic&Non_Endemic: 3
* Non_endemic: 4
* Endemic_MaxAge: 5 or 6 $missing_species
- number of island species
that were not sampled for particular clade (only applicable for endemic
clades) $type1or2
- whether the colonist belongs to type 1 or
type 2. In this dataset all are equal to 1.
A list with 40 elements, the first of which contains 2 elements and the following 39 containing 5 components.
Valente L, Etienne RS, Garcia-R JC (2019) Deep Macroevolutionary Impact of
Humans on New Zealand’s
Unique Avifauna. Current Biology, 29, 2563–2569.
DAISIE_dataprep
, DAISIE_ML
, DAISIE_SR_ML
stac
settingsA table containing the information regarding the meaning
of the stac
codes utilised by DAISIE's ML functions. It is used to
render the "DAISIE stac
values" vignette. stac
stands for "status of the clade" formed by the immigrant. It is
an important part of DAISIE objects that informs the likelihood functions
about the endemicity status and type of data available for each insular
clade. Each colonisation event that has extant species on the island needs to
have a stac
value specified. This also has implications in what is
included in the DAISIE object "branching_times"
vector, which also
described in this table.
The table is composed of the following columns:
$stac: A numeric with each stac code from 1 until 9.
$Input for DAISIE_dataprep table "Clade_Name": A character
with the possibilities for input in DAISIE_dataprep()
of each clade, which are then translated to a numeric stac
code as
in $stac
.
$Type of species or clade": A character with the plain English explanation of the different possible kinds of island lineages that can be considered by DAISIE.
$Input for DAISIE_dataprep table "Branching_times": A character with the plain English explanation of what the branching times vector in the DAISIE object should contain.
$Colonisation times: A character with the plain English explanation of what the colonisation time in the branching times vector of the DAISIE object (first element of the vector) means.
A table with 9 rows and 5 columns.