Runs a Bayesian implementation of the General Mixed Yule-Coalescent (bGMYC)
model using the embedded C GMYC engine. Likelihood evaluations are performed
in C (via C_gmyc_loglik), eliminating the dependency on the external
bGMYC package.
Arguments
- tree
An ultrametric, fully binary
phyloobject.- mcmc
Integer. Total MCMC steps (default 11 000).
- burnin
Integer. Steps discarded as burn-in (default 1 000).
- thinning
Integer. Thinning interval; every
thinning-th post-burnin step is retained (default 100).- py1, py2
Numeric. Prior bounds for the Yule rate-change exponent (default 0 and 2).
- pc1, pc2
Numeric. Prior bounds for the coalescent rate-change exponent (default 0 and 2).
- t1, t2
Integer. Prior bounds for the threshold parameter (number of species). Defaults:
t1 = 2,t2 = NULL(auto:Nnode - 1).- scale
Numeric vector of length 3. Proposal scale parameters for
py,pc, andt(defaultc(20, 10, 5)).- start
Numeric vector of length 3. Starting values for
py,pc, andt(defaultc(1, 0.5, 50)).- ppcutoff
Numeric. Posterior co-occurrence probability threshold used to compute the point-estimate
$assignments. Tip pairs with posterior probability of co-occurrence \(\geq\)ppcutoffare merged into the same species (default 0.05). Can be recomputed later viabgmyc_tbl.- quiet
Logical. Suppress progress output (default
FALSE).
Value
An object of class "bgmyc_fit", a named list with:
parMatrix of retained MCMC samples (rows = samples, columns
py,pc,t,loglik).assignmentsData frame with columns
labels(tip labels) andbgmyc(integer species index), giving the point-estimate partition atppcutoff.probmatNumeric matrix (
n_tips * n_tips) of posterior co-occurrence probabilities. Use withbgmyc_tblto recompute the partition at any cutoff.accept_ratesNamed numeric vector of per-parameter acceptance rates (
py,pc,t).mcmc,burnin,thinningInteger scalars.
treeThe input
phyloobject.
Details
The Metropolis-within-Gibbs sampler follows Reid & Carstens (2012): a gamma
proposal for py and pc, and a Gaussian random walk for the
integer threshold t. The prior is uniform on
[py1, py2] * [pc1, pc2] * {t1, ..., t2}.