Skip to contents

Run 2 type DAISIE analysis

Usage

run_daisie_2type_ml(
  daisie_data,
  data_name,
  model,
  array_index,
  cond,
  methode = "lsodes",
  optimmethod = "subplex",
  results_dir = NULL,
  low_rates = FALSE,
  rep_index = "NULL",
  res = 100,
  prop_type2_pool,
  test = FALSE
)

Arguments

daisie_data

A list, conforming to the DAISIE object format. Usually preprocessed by DAISIE::DAISIE_dataprep(), see it's documentation for details. Otherwise it may be generated via simulations, using DAISIE::DAISIE_sim_cr() and friends.

data_name

String. Will be used for the name of the created output folder.

model

A string with model that should run. Models are as follows:

  • "cr_dd" Clade specific model - diversity dependent. All parameters free.

  • "cr_di" Clade specific model - diversity independent (K = Inf). All other parameters free.

  • "cr_dd_0laa" Clade specific model - diversity dependent and no anagenesis (laa fixed to zero). All other parameters free.

  • "cr_di_0laa" Clade specific model - diversity independent (K = Inf) and no anagenesis (laa fixed to zero). All other parameters free.

  • "cr_di_0lac" Clade specific model - diversity indendent (K = Inf) and no cladogenesis (lac fixed to zero). All other parameters free.

  • "cr_dd_0lac" Clade specific model - diversity dependent and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_lac_di" Clade specific model - diversity independent (K = Inf) and relaxed cladogenesis. All other parameters free.

  • "rr_lac_dd" Clade specific model - diversity dependent and relaxed cladogenesis. All other parameters free.

  • "rr_mu_di" Clade specific model - diversity independent (K = Inf) and relaxed extinction. All other parameters free.

  • "rr_mu_dd" Clade specific model - diversity dependent and relaxed extinction. All other parameters free.

  • "rr_k" Clade specific model - diversity dependent and relaxed carrying capacity. All other parameters free.

  • "rr_gam_di" Clade specific model - diversity independent (K = Inf) and relaxed colonisation. All other parameters free.

  • "rr_gam_dd" Clade specific model - diversity dependent and relaxed colonisation. All other parameters free.

  • "rr_laa_di" Clade specific model - diversity independent (K = Inf) and relaxed anagenesis. All other parameters free.

  • "rr_laa_dd" Clade specific model - diversity dependent and relaxed anagenesis. All other parameters free.

  • "rr_mu_di_0lac" Clade specific model - diversity independent, relaxed extinction, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_mu_dd_0lac" Clade specific model - diversity dependent, relaxed extinction, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_k_0lac" Clade specific model - diversity dependent, relaxed carrying capacity, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_gam_di_0lac" Clade specific model - diversity independent, relaxed colonisation, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "r_gam_dd_0lac" Clade specific model - diversity dependent, relaxed colonisation, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_laa_di_0lac" Clade specific model - diversity independent, relaxed anagenesis, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "r_laa_dd_0lac" Clade specific model - diversity dependent, relaxed anagenesis, and no cladogenesis (lac fixed to zero). All other parameters free.

  • "rr_lac_di_0laa" Clade specific model - diversity independent, relaxed cladogenesis, and no anagenesis (laa fixed to zero)

  • "rr_lac_dd_0laa" Clade specific model - diversity dependent

  • "rr_mu_di_0laa" Clade specific model - diversity independent

  • "rr_mu_dd_0laa" Clade specific model - diversity dependent

  • "rr_k_0laa" Clade specific model - diversity dependent

  • "rr_gam_di_0laa" Clade specific model - diversity independent, relaxed colonisation, and no anagenesis (laa fixed to zero). All other parameters free

  • "rr_gam_dd_0laa" Clade specific model - diversity dependent, relaxed colonisation, and no anagenesis (laa fixed to zero). All other parameters free

array_index

A single numeric with the array index. It is used for naming the output file.

cond

An integer specifying conditioning, as described in DAISIE::DAISIE_ML_CS().

methode

Method of the ODE-solver. Supported Boost ODEINT solvers (steppers) are: "odeint::runge_kutta_cash_karp54" "odeint::runge_kutta_fehlberg78" "odeint::runge_kutta_dopri5" "odeint::bulirsch_stoer" without odeint::-prefix, \link{deSolve}{ode}() method is assumed. The default method overall is "lsodes" for \link{DAISIE_ML_CS}() and "ode45" from \link[deSolve]{ode}() for \link{DAISIE_ML_IW}().

optimmethod

Method used in likelihood optimization. Default is subplex (see \link[subplex]{subplex}() for full details). Alternative is "simplex" which was the method in previous versions.

results_dir

A string with the path to the directory where results are to be stored or can be found. For example, if the data in question is (to be) stored in folder_with_res/$data_name, then results_dir should be "folder_with_res". Defaults to NULL, which indicates the default directories are to be used. Default directories are: * $HOME/results/$data_name if on the cluster * getwd()/results/$data_name if called from another environment If is.na(results_dir), then the object is returned to the R session and not saved to file.

low_rates

Boolean determining whether the random sampling of initial parameter estimates should be sampled from a broad range (FALSE) or from a restricted range where the initial rates a ensured to be smaller (TRUE). The latter helps when using large datasets that may fail the initial likelihood computation with higher rates that could be sampled from the broad range of rates.

rep_index

A string which by default is "NULL" (it is a string and not a true NULL due to being passed from the command line), or can be a string of a numeric which is used to detect whether multiple data set from the same data source is being run. This is the case, for example, when fitting a DAISIE model to a posterior distribution of data.

res

A numeric determining the resolution of the likelihood calculations, it sets the limit for the maximum number of species for which a probability must be computed, which must be larger than the size of the largest clade.

prop_type2_pool

A numeric determining the proportion of the mainland species pool that is composed on type 2 species.

test

A boolean, defaults to FALSE. Set to TRUE for testing purposes, to fix the seed.

Value

Nothing. Writes DAISIE analysis results to a .rds file. This file is stored in file_path. The directory in of file_path is created if it doesn't exist.

Author

Pedro Santos Neves, Joshua W. Lambert, Luis Valente

Examples

if (FALSE) {
data(Galapagos_datalist, package = "DAISIE")
run_daisie_2type_ml(
  daisie_data = Galapagos_datalist,
  data_name = "Galapagos_datalist",
  model = "cr_dd",
  array_index = 1,
  cond = 1
)
}