Package: corHMM 2.10.5

Jeremy Beaulieu

corHMM: Hidden Markov Models of Character Evolution

Fits hidden Markov models of discrete character evolution which allow different transition rate classes on different portions of a phylogeny. Beaulieu et al (2013) <doi:10.1093/sysbio/syt034>.

Authors:Jeremy Beaulieu [aut, cre], Brian O'Meara [aut], Jeffrey Oliver [aut], James Boyko [aut], Haoyu Ji [ctb], Ben Bolker [ctb]

corHMM_2.10.5.tar.gz
corHMM_2.10.5.zip(r-4.7-any)corHMM_2.10.5.zip(r-4.6-any)corHMM_2.10.5.zip(r-4.5-any)
corHMM_2.10.5.tgz(r-4.6-any)corHMM_2.10.5.tgz(r-4.5-any)
corHMM_2.10.5.tar.gz(r-4.7-any)corHMM_2.10.5.tar.gz(r-4.6-any)
corHMM_2.10.5.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
corHMM/json (API)

# Install 'corHMM' in R:
install.packages('corHMM', repos = c('https://phylotastic.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/thej022214/corhmm/issues

Datasets:

On CRAN:

Conda:

9.25 score 15 stars 2 packages 560 scripts 2.4k downloads 36 exports 66 dependencies

Last updated from:03a93238fb. Checks:7 NOTE, 2 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develNOTE203
source / vignettesOK279
linux-releaseNOTE183
macos-releaseNOTE185
macos-oldrelNOTE140
windows-develNOTE105
windows-releaseNOTE125
windows-oldrelNOTE149
wasm-releaseOK122

Exports:ancRECONancRECON_slicecompute_joint_ciComputeCIConvertPhangornReconstructionscorDISCcorHMMcorHMMDredgecorHMMDredgeBasedev.raydiscdropStateMatParsequateStateMatParsfitCorrelationTestget_batch_profile_likgetCVTablegetFullMatgetModelTablegetRateCatMatgetStateMat4DatkFoldCrossValidationmakeSimmapnode_importance_by_clusterphylo_aware_dist_fastphylo_aware_dist_localplot_batch_profile_likplot_clustered_phyloplot_raw_reconplot_stacked_densitiesplot_transition_summaryplotDredgeTraceplotMKmodelplotRECONrayDISCsimMarkovsummarize_single_simmapsummarize_transition_stats

Dependencies:apebackportscheckmatecliclusterGenerationcodacodetoolscombinatcorpcorcpp11DEoptimdigestdoParallelexpmfarverforeachfuturefuture.applygenericsGenSAggplot2globalsgluegmpgridExtragtableigraphisobanditeratorslabelinglatticelhslifecyclelistenvmagrittrmapsMASSMatrixmnormtnlmenloptrnnetnumDerivoptimParallelosqpparallellyphangornphytoolspkgconfigprogressrR6RColorBrewerRcppRcppArmadilloRcppEigenrlangRmpfrRTMBS7scalesscatterplot3dTMBvctrsviridisviridisLitewithr

Uncertainty in joint ancestral state reconstruction
What this vignette is for | 1. Fit a model and get the best joint reconstruction | 2. Sample the joint posterior | 3. A distance between reconstructions | If you want it faster | 4. Consensus clustering | 5. What the axes look like | 6. Where on the tree do they disagree? | 7. Turning axes into numbers | Adapting this to your data | Function reference | Reference

Last update: 2026-09-10
Started: 2026-09-10

corHMM 2.1: Generalized hidden Markov models
Section 1: Default use of corHMM | 1.1: No hidden rate categories | 1.2: A trait with any number of states and any number of hidden rate categories | 1.3: Estimating "tip fog" | Section 2: How to make and interpret custom models | 2.1: Creating and using custom rate matrices | 2.1.1: One rate category | 2.1.2: Any number of rate categories | 2.2: Biological examples | 2.2.1: Ordered habitat change | 2.2.2: The precursor model | 2.2.3: Ontological relationship of multiple characters | Section 3: Estimating models when node states are fixed | 3.1: Fixing a single node | 3.2: Estimating rates under a parsimony reconstruction | 3.3: Fixing nodes when the model contains hidden states | References

Last update: 2026-03-06
Started: 2020-06-15

Readme and manuals

Help Manual

Help pageTopics
Ancestral state reconstructionancRECON
Ancestral state reconstruction for a particular timeancRECON_slice
Compute joint ancestral-state reconstructions by samplingcompute_joint_ci
Compute confidence around rate estimatesComputeCI
Convert phangorn reconstruction to a vectorConvertPhangornReconstructions
Correlated evolution binary traitscorDISC
Hidden Rates ModelcorHMM
Automatic Discovery of Optimal Discrete Character Models via Simulated AnnealingcorHMMDredge
Fit a Single Penalized Hidden Markov ModelcorHMMDredgeBase
Dents the likelihood surface This takes any values that are better (lower) than the desired negative log likelihood and reflects them across the best_neglnL + delta line, "denting" the likelihood surface.dent_likelihood
Propose new values This proposes new values using a normal distribution centered on the original parameter values, with desired standard deviation. If any proposed values are outside the bounds, it will propose again.dent_propose
Sample points from along a ridge This "dents" the likelihood surface by reflecting points better than a threshold back across the threshold (think of taking a hollow plastic model of a mountain and punching the top so it's a volcano). It then uses essentially a Metropolis-Hastings walk to wander around the new rim. It adjusts the proposal width so that it samples points around the desired likelihood. This is better than using the curvature at the maximum likelihood estimate since it can actually sample points in case the assumptions of the curvature method do not hold. It is better than varying one parameter at a time while holding others constant because that could miss ridges: if I am fitting 5=x+y, and get a point estimate of (3,2), the reality is that there are an infinite range of values of x and y that will sum to 5, but if I hold x constant it looks like y is estimated very precisely. Of course, one could just fully embrace the Metropolis-Hastings lifestyle and use a full Bayesian approach.dent_walk
Example datasetsprimates primates.paint rayDISC.example
Test for correlationfitCorrelationTest
Perform Batch Profile Likelihood Analysis for Multiple Parametersget_batch_profile_lik
Print Method for corhmm.kfold Class ObjectsgetCVTable
Combines several rate class index matricesdropStateMatPars equateStateMatPars getFullMat getRateCatMat
Summarize Model Statistics for a List of corHMM ObjectsgetModelTable
Produce an index matrix and legend from a datasetgetStateMat4Dat
Perform K-Fold Cross-Validation for corHMM ModelskFoldCrossValidation
Simulate a character historymakeSimmap
Identify nodes that distinguish clusters of reconstructionsnode_importance_by_cluster
Compile a faster version of the reconstruction distancephylo_aware_dist_fast
Phylogenetically aware distance between two reconstructionsphylo_aware_dist_local
Plot Batch Profile Likelihoodsplot_batch_profile_lik
Plot competing ancestral histories on a phylogenyplot_clustered_phylo
Raster plot of a sample of joint reconstructionsplot_raw_recon
Stacked log-likelihood densities by clusterplot_stacked_densities
Plot Summary Statistics of Stochastic Character Map Transitionsplot_transition_summary
Plot the dented samples This will show the univariate plots of the parameter values versus the likelihood as well as bivariate plots of pairs of parameters to look for ridges.plot.dentist
Plot the Trace of a corHMMDredge Simulated Annealing SearchplotDredgeTrace
Plot a Markov modelplotMKmodel
Plot ancestral state reconstructionsplotRECON
Print dentist print summary of output from dent_walkprint.dentist
Evolution of categorical traitsdev.raydisc rayDISC
Simulate a character on the treesimMarkov
Summarize Transition Information from Stochastic Character Mapssummarize_single_simmap summarize_transition_stats
Summarize dentist Display summary of output from dent_walksummary.dentist
The Probability of a Tip State Being HomologoustipHomology