Learn R Programming

laser (version 2.4-1)

calcLHbd: Calculate Likelihood of Branching Times Under Birth-Death Model

Description

Calculates the likelihood of branching times given a vector of branching times and parameters r (net diversification rate; speciation rate S - extinction rate E) and a (the extinction fraction, E/S)

Usage

calcLHbd(x, r, a)

Arguments

x
a numeric vector of branching times
r
the net diverrsification rate, S - E
a
the extinction fraction, E/S

Value

the likelihood of the branching times given a and r

Details

A function that can be called to explore alternative parameterizations of the birth-death process, to bootstrap likelihood confidence regions, or to generate plots of likelihood surfaces (as in Nee et al. 1994).

References

Kendall, D. G. 1948. On the generalized "birth-and-death" process. Ann. Math. Stat. 19:1-15.

Nee, S., E. C. Holmes, R. M. May, and P. H. Harvey. 1994a. Extinction rates can be estimated from molecular phylogenies. Philos. Trans. R. Soc. Lond. B 344:77-82.

Nee, S., R. M. May, and P. H. Harvey. 1994b. The reconstructed evolutionary process. Philos. Trans. R. Soc. Lond. B 344:305-311.

See Also

bd, pureBirth

Examples

Run this code

#plot a likelihood surface for the plethodon dataset
data("plethodon")
rvector <- seq(.001, .04, length.out = 100)
avector <- seq(0, 0.99, length.out = 100)
#calculating likelihoods:
lmatrix <- matrix(0, length(rvector), length(avector))
for (i in 1:length(rvector)){
  for (j in 1:length(avector)){
    lmatrix[i,j] <- calcLHbd(plethodon, rvector[i], avector[j])
    }
   }
 
 #Now to plot surface:
 lmax <- max(lmatrix)      #maximum calculated LH
 filled.contour(rvector, avector, lmatrix, 
                levels = seq(lmax-5, lmax, length.out = 20), 
                col = heat.colors(20), xlab = "Net Diversification Rate", 
                ylab = "Extinction Fraction", key.title = title("Log-LH"))
 
 # plots the surface.  See ?filled.contour for help on this plotting function.
               

Run the code above in your browser using DataLab