Description Usage Arguments Value Author(s) References See Also Examples
Computes likelihood for the presence-absence data of species in a local community for a given phylogeny of species in the region.
1 2 3 4 5 6 7 8 9 10 11 | DAMOCLES_loglik(
phy,
pa,
pars,
pchoice = 0,
edgeTList = NULL,
methode = "analytical",
model = 0,
Mlist = NULL,
verbose = FALSE
)
|
phy |
phylogeny in phylo format |
pa |
presence-absence table with the first column the species labels and the second column the presence (1) or absence (0) of the species |
pars |
Vector of model parameters: |
pchoice |
sets the p-value to optimize: |
edgeTList |
list of edge lengths that need to be succesively pruned; if not specified, it will computed using compute_edgeTList |
methode |
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 |
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) |
Mlist |
list of M matrices that can be specified when methode = 'analytical'. If set at NULL (default) and methode = 'analytical', Mlist will be computed. |
verbose |
Whether intermediate output should be printed. Default is FALSE. |
The loglikelihood
Rampal S. Etienne
Pigot, A.L. & R.S. Etienne (2015). A new dynamic null model for phylogenetic community structure. Ecology Letters 18: 153-163.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #TEST IT WORKS
library(ape)
phy = ape::rcoal(100)
pars = c(0.5,0.1,0.1)
pa = rbinom(100,c(0,1),0.5)
pa = matrix(c(phy$tip.label,pa),nrow = length(phy$tip.label),ncol = 2)
# - without a root edge
loglik = DAMOCLES_loglik(phy,pa,pars)
loglik
# - with a root edge
phy$root.edge = 2
loglik = DAMOCLES_loglik(phy,pa,pars)
loglik
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.