Skip to contents

Runs a bootstrapping on a DAISIE model to determine parameter precision

Usage

bootstrap(
  daisie_data,
  data_name,
  model,
  array_index,
  cond,
  methode = "lsodes",
  optimmethod = "subplex",
  results_dir = NULL,
  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.

test

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

Value

Nothing. Writes bootstrapping results to a .rds file. This file is stored in $HOME/results/data_name if running on the cluster or /results/data_name if running locally. The directory is created if it doesn't exist.

Examples

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