This function computes the maximum likelihood estimates of the parameters of the DAMOCLES model for a given phylogeny and presence-absence data. It also outputs the corresponding loglikelihood that can be used in model comparisons.
DAMOCLES_ML(
phy,
pa,
initparsopt,
idparsopt = 1:length(initparsopt),
parsfix = NULL,
idparsfix = NULL,
idparsequal = NULL,
pars2 = c(0.001, 1e-04, 1e-05, 1000),
optimmethod = "subplex",
pchoice = 0,
edgeTList = NULL,
methode = "analytical",
model = 0,
verbose = FALSE
)
phylogeny in phylo format
presence-absence table. The first column contains the labels of the species (corresponding to the tip labels in the phylogeny. The second column contains the presence (1) or absence (0) of species in the local community.
The initial values of the parameters that must be optimized
The ids of the parameters that must be optimized, e.g. 1:2 for extinction rate, and offset of immigration rate The ids are defined as follows: id == 1 corresponds to mu (extinction rate) id == 2 corresponds to gamma_0 (offset of immigration rate) id == 3 corresponds to gamma_1 (parameter controlling decline in immigration rate with time)
The values of the parameters that should not be optimized. See idparsfix.
The ids of the parameters that should not be optimized, e.g. c(1,3) if mu and gamma_1 should not be optimized, but only gamma_0. In that case idparsopt must be c(2). The default is to fix all parameters not specified in idparsopt.
The ids of the parameters that should be set equal to the first parameter of the same type.
Vector of settings:
pars2[1]
sets the relative tolerance in the parameters
pars2[2]
sets the relative tolerance in the function
pars2[3]
sets the absolute tolerance in the parameters
pars2[4]
sets the maximum number of iterations
Method used in optimization of the likelihood. Current default is 'subplex'. Alternative is 'simplex' (default of previous version)
sets the p-value to optimize: pchoice == 0 corresponds to the sum of p_0f + p_1f pchoice == 1 corresponds to p_0f pchoice == 2 corresponds to p_1f
list of edge lengths that need to be succesively pruned; if not specified, it will computed using compute_edgeTList
method used to solve the ODE. Either 'analytical' for the analytical solution, 'Matrix' for matrix exponentiation using package Matrix or 'expm' using package 'expm' or any of the numerical solvers, used in deSolve.
model used. Default is 0 (standard null model). Other options are 1 (binary traits) 2 (trinary environmental trait) or 3 (diversity-dependent colonization - beta version)
Whether intermediate output should be printed. Default is FALSE.
gives the maximum likelihood estimate of mu
gives the maximum likelihood estimate of gamma_0
gives the maximum likelihood estimate of gamma_1
gives the maximum loglikelihood
gives the number of estimated parameters, i.e. degrees of feedom
gives a message on convergence of optimization; conv = 0 means convergence
The output is a dataframe containing estimated parameters and maximum loglikelihood.
Pigot, A.L. & R.S. Etienne (2015). A new dynamic null model for phylogenetic community structure. Ecology Letters 18: 153-163.