Package: corHMM 2.10.4

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.4.tar.gz
corHMM_2.10.4.zip(r-4.7)corHMM_2.10.4.zip(r-4.6)corHMM_2.10.4.zip(r-4.5)
corHMM_2.10.4.tgz(r-4.6-any)corHMM_2.10.4.tgz(r-4.5-any)
corHMM_2.10.4.tar.gz(r-4.7-any)corHMM_2.10.4.tar.gz(r-4.6-any)
manual.pdf |manual.html
card.svg |card.png
corHMM/json (API)
NEWS

# 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.60 score 15 stars 2 packages 563 scripts 653 downloads 20 mentions 30 exports 66 dependencies

Last updated from:ddadab2f62. Checks:7 NOTE, 1 OK, 1 FAIL. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64NOTE228
source / vignettesOK308
linux-release-x86_64NOTE218
macos-release-arm64NOTE161
macos-oldrel-arm64NOTE131
windows-develNOTE145
windows-releaseNOTE144
windows-oldrelNOTE161
wasm-releaseFAIL133

Exports:ancRECONancRECON_slicecompute_joint_ciComputeCIConvertPhangornReconstructionscorDISCcorHMMcorHMMDredgecorHMMDredgeBasedev.raydiscdropStateMatParsequateStateMatParsfitCorrelationTestget_batch_profile_likgetCVTablegetFullMatgetModelTablegetRateCatMatgetStateMat4DatkFoldCrossValidationmakeSimmapplot_batch_profile_likplot_transition_summaryplotDredgeTraceplotMKmodelplotRECONrayDISCsimMarkovsummarize_single_simmapsummarize_transition_stats

Dependencies:apebackportscheckmatecliclusterGenerationcodacodetoolscombinatcorpcorcpp11DEoptimdigestdoParallelexpmfarverforeachfuturefuture.applygenericsGenSAggplot2globalsgluegmpgridExtragtableigraphisobanditeratorslabelinglatticelhslifecyclelistenvmagrittrmapsMASSMatrixmnormtnlmenloptrnnetnumDerivoptimParallelosqpparallellyphangornphytoolspkgconfigprogressrR6RColorBrewerRcppRcppArmadilloRcppEigenrlangRmpfrRTMBS7scalesscatterplot3dTMBvctrsviridisviridisLitewithr

corHMM 2.1: Generalized hidden Markov models

Rendered fromcorHMMv2.1-vignette.Rmdusingknitr::rmarkdownon Jun 03 2026.

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
Plot Batch Profile Likelihoodsplot_batch_profile_lik
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