gauss.quad: Estimate marginal likelihood by thermodynamic integration

View source: R/marginal-lhd.R

gauss.quadR Documentation

Estimate marginal likelihood by thermodynamic integration

Description

Estimate marginal likelihood by thermodynamic integration and Gauss-Legendre quadrature from a sample of n power posterior MCMC chains sampled with mcmctree (or bpp).

Usage

gauss.quad(mcmcf = "mcmc.txt", betaf = "beta.txt")

Arguments

mcmcf

character, mcmc output file name

betaf

character, file with beta values

Details

The MCMC samples should be stored in a directory structure created by make.bfctlf with method = "gauss-quad". The function will read the stored log-likelihood values and calculate the log-marginal likelihood.

Numerical integration is done using Gauss-Legendre quadrature. See Rannala and Yang (2017) for details (also dos Reis et al. 2017, Appendix 2).

Value

A list with components logml, the log-marginal likelihood estimate; se, the standard error of the estimate; mean.logl, the mean of log-likelihood values sampled for each beta; and b, the beta values used.

Author(s)

Mario dos Reis

References

Rannala B and Yang Z. (2017) Efficient Bayesian species tree inference under the multispecies coalescent. Systematic Biology 66: 823-842.

dos Reis et al. (2017) Using phylogenomic data to explore the effects of relaxed clocks and calibration strategies on divergence time estimation: Primates as a test case. bioRxiv

See Also

make.bfctlf to prepare directories and mcmctree or bpp control files to calculate the power posterior.


dosreislab/bppr documentation built on April 10, 2023, 6:12 p.m.