DAISIE_MW_ML: Maximization of the loglikelihood under the DAISIE model with...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/DAISIE_MW_ML.R

Description

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 mainlandor nearest landmass, 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 the of 'sigmoidal_col_ana', the 11th parameter is the d0 for colonization and the 12th is the d0 for anagenesis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
)

Arguments

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.
The first element of the list has two or three components:

$island_age - the island age
Then, depending on whether a distinction between types is made, we have:
$not_present - the number of mainland lineages that are not present on the island
or:
$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 remaining 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 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
* Endemic_Singleton_MaxAge: 5
* Endemic_Clade_MaxAge: 6
* Endemic&Non_Endemic_Clade_MaxAge: 7

$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

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:

id = 1 corresponds to lambda^c (cladogenesis rate)
id = 2 corresponds to mu (extinction rate)
id = 3 corresponds to K (clade-level carrying capacity)
id = 4 corresponds to gamma (immigration rate)
id = 5 corresponds to lambda^a (anagenesis rate)
id = 6 corresponds to lambda^c (cladogenesis rate) for an optional subset of the species
id = 7 corresponds to mu (extinction rate) for an optional subset of the species
id = 8 corresponds to K (clade-level carrying capacity) for an optional subset of the species
id = 9 corresponds to gamma (immigration rate) for an optional subset of the species
id = 10 corresponds to lambda^a (anagenesis rate) for an optional subset of the species
id = 11 corresponds to p_f (fraction of mainland species that belongs to the second subset of species.

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:

ddmodel = 0 : no diversity dependence
ddmodel = 1 : linear dependence in speciation rate
ddmodel = 11: linear dependence in speciation rate and in immigration rate
ddmodel = 2 : exponential dependence in speciation rate
ddmodel = 21: exponential dependence in speciation rate and in immigration rate

cond

cond = 0 : conditioning on island age
cond = 1 : conditioning on island age and non-extinction of the island biota
.

island_ontogeny

In DAISIE_sim_time_dependent, DAISIE_ML_CS and plotting a string describing the type of island ontogeny. Can be "const", "beta" for a beta function describing area through time. String checked by is_island_ontogeny_input.
In all other functions a numeric describing the type of island ontogeny. Can be 0 for constant, 1 for a beta function describing area through time. In ML functions island_ontogeny = NA assumes constant ontogeny.

tol

Sets the tolerances in the optimization. Consists of:
reltolx = relative tolerance of parameter values in optimization
reltolf = relative tolerance of function value in optimization
abstolx = absolute tolerance of parameter values in optimization.

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

For internal testing purposes only. Default is 1, the original DAISIE code.

verbose

In simulation and dataprep functions a logical, Default = TRUE gives intermediate output should be printed. For ML functions a numeric determining if intermediate output should be printed, Default = 0 does not print, verbose = 1 prints intermediate output of the parameters and loglikelihood, verbose = 2 means also intermediate progress during loglikelihood computation is shown.

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'. Alternatives are an exponantial 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 signoids 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'.

Value

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

Author(s)

Rampal S. Etienne

References

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>.

See Also

DAISIE_ML_CS,

Examples

1
cat('No examples')

xieshu95/DAISIE_new documentation built on March 20, 2020, 5:31 a.m.