analyze.coalescent: analyzes the fit of coalescent genealogies to species trees

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

Description

takes data read into R using read.starbeast and uses posterior predictive simulation to evaluate the fit of the estimated coalescent genealogies to the estimated species trees from the analysis

Usage

1
analyze.coalescent(data, msdir = "/directory/containing/ms")

Arguments

data

data read in using read.starbeast

msdir

msdir is the directory containing the a compiled executable of Hudson's ms software. this software is used to simulate coalescent genealogies.

Details

This function analyzes the fit of the estimated coalescent genealogies to the estimated species tree generated by *BEAST. It does this by simulating new genealogies from the posterior and comparing the fit of the simulated and empirical coalescent genealogies to the empirical species trees. It uses two test statistics: the likelihood of the coalescent genealogy given the species tree and the number of deep coalescences. It calculates these statistics for each locus. The sum and coefficient of variation across loci is calculated using the summary function, and all statistics can be visualized using plot.

At the moment, this function can only be used if the "piecewise constant" option for effective population sizes was specified in *BEAST. It cannot handle population sizes that vary within a branch ("piecewise linear") because ms only simulates exponential population size change while *BEAST estimates a linear function.

Value

The function returns an object of class "coalescentteststats". This object contains two lists, "coal" and "probs", which contain the deep coalescence and likelihood statistics, respectively. Each list contains three matrices corresponding to the empirical ("empirical") and simulated values ("simulated") for each statistic, and the difference between them ("test.stat"), which is a distribution whose expected mean is 0.

Author(s)

Noah Reid

References

Reid et al. 2012. Poor fit to the multispecies coalescent is widely detectable in empirical data. Submitted to Systematic Biology. Gelman et al. 2003. Bayesian Data Analysis.

See Also

'plot', 'summary', 'analyze.sequences', 'read.starbeast'

Examples

1
2
3
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

fmichonneau/starbeastPPS documentation built on May 16, 2019, 1:47 p.m.