likelihood_t_MC: Likelihood of a dataset under the matching competition model.

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

View source: R/likelihood_t_MC.R

Description

Computes the likelihood of a dataset under the matching competition model with specified sigma2 and S values.

Usage

1

Arguments

phylo

an object of type 'phylo' (see ape documentation)

data

a named vector of continuous data with names corresponding to phylo$tip.label

par

a vector listing a value for log(sig2) (see Note) and S (parameters of the matching competition model), in that order

Details

When specifying par, log(sig2) must be listed before S.

Value

the negative log-likelihood value of the dataset (accordingly, the negative of the output should be recorded as the likelihood), given the phylogeny and sig2 and S values

Note

To stabilize optimization, this function exponentiates the input sig2 value, thus the user must input the log(sig2) value to compute the correct log likelihood (see example).

Author(s)

Jonathan Drury drury@biologie.ens.fr

Julien Clavel

References

Drury, J., Clavel, J., Manceau, M., and Morlon, H. 2016. Estimating the effect of competition on trait evolution using maximum likelihood inference. Systematic Biology doi 10.1093/sysbio/syw020

Nuismer, S. & Harmon, L. 2015. Predicting rates of interspecific interaction from phylogenetic trees. Ecology Letters 18:17-27.

See Also

fit_t_comp likelihood_t_MC_geog

Examples

1
2
3
4
5
6
7
data(Anolis.data)
phylo <- Anolis.data$phylo
pPC1 <- Anolis.data$data

# Compute the likelihood that the S value is twice the ML estimate
par <- c(0.0003139751, (2*-0.06387258))
lh <- -likelihood_t_MC(phylo,pPC1,par)

RPANDA documentation built on May 29, 2017, 3:34 p.m.

Search within the RPANDA package
Search all R packages, documentation and source code