Package: hmmTMB 1.1.2

hmmTMB: Fit Hidden Markov Models using Template Model Builder

Fitting hidden Markov models using automatic differentiation and Laplace approximation, allowing for fast inference and flexible covariate effects (including random effects and smoothing splines) on model parameters. The package is described by Michelot (2025) <doi:10.18637/jss.v114.i05>.

Authors:Theo Michelot [aut, cre], Richard Glennie [aut], Jan-Ole Fischer [ctb], Duncan Cameron-Steinke [ctb], Pauline Rocu [ctb]

hmmTMB_1.1.2.tar.gz
hmmTMB_1.1.2.zip(r-4.7-x86_64)hmmTMB_1.1.2.zip(r-4.7-arm64)hmmTMB_1.1.2.zip(r-4.6-x86_64)hmmTMB_1.1.2.zip(r-4.6-arm64)hmmTMB_1.1.2.zip(r-4.5-x86_64)
hmmTMB_1.1.2.tgz(r-4.6-x86_64)hmmTMB_1.1.2.tgz(r-4.6-arm64)hmmTMB_1.1.2.tgz(r-4.5-x86_64)hmmTMB_1.1.2.tgz(r-4.5-arm64)
hmmTMB_1.1.2.tar.gz(r-4.7-arm64)hmmTMB_1.1.2.tar.gz(r-4.7-x86_64)hmmTMB_1.1.2.tar.gz(r-4.6-arm64)hmmTMB_1.1.2.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
hmmTMB/json (API)

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

Bug tracker:https://github.com/theomichelot/hmmtmb/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

hidden-markov-modelhmmmixed-effects-modelsrandom-effectssmoothing-splinestime-series-analysiscpp

7.61 score 70 stars 138 scripts 464 downloads 16 exports 71 dependencies

Last updated from:4d3c65f37b. Checks:13 WARNING, 1 ERROR, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING333
linux-devel-x86_64WARNING305
source / vignettesERROR1057
linux-release-arm64WARNING309
linux-release-x86_64WARNING355
macos-release-arm64WARNING321
macos-release-x86_64WARNING661
macos-oldrel-arm64WARNING363
macos-oldrel-x86_64WARNING641
windows-devel-arm64WARNING397
windows-devel-x86_64WARNING455
windows-release-arm64WARNING412
windows-release-x86_64WARNING277
windows-oldrel-x86_64WARNING375
wasm-releaseFAIL175

Exports:as_character_formulaDistForecastHMMinvmlogitis_whole_numberlogsumexpmake_formulasMarkovChainmlogitmvnorm_invlinkmvnorm_linkObservationprec_to_covquad_pos_solvestrip_comments

Dependencies:abindbackportsBHcallrcheckmateclassclassIntclicpp11DBIdescdistributionaldplyre1071farverfmeshergenericsggplot2gluegridExtragtableinlineisobandKernSmoothlabelinglatticelifecycleloomagrittrMASSMatrixmatrixStatsmgcvnlmenumDerivotelpillarpkgbuildpkgconfigposteriorprocessxproxypsQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelrlangrstans2S7scalessfspsplancsStanHeadersstringistringrtensorAtibbletidyselectTMBtmbstanunitsutf8vctrsviridisLitewithrwk

Readme and manuals

Help Manual

Help pageTopics
Read formula with as.character without splittingas_character_formula
Transforms matrix to dgTMatrixas_sparse
Create block diagonal matrix (safe version)bdiag_check
Check values in vector are contiguouscheck_contiguous
Check that only supported smooths are usedcheck_smooths
Grid of covariatescov_grid
Grid of covariate values over two covariatescov_grid_2d
Covariate names that are columns of the datacov_names_in_data
R6 class for probability distributionDist
Density function of von Mises distributiondvm
Density function of wrapped Cauchy distributiondwrpcauchy
Find s(, bs = "re") terms in formulafind_re
R6 Class for Forecast in Hidden Markov ModelsForecast
Shell gam object for building prediction matricesgam_shell
Generalized matrix determinantgdeterminant
R6 class for hidden Markov modelHMM
hmmTMB colour palettehmmTMB_cols
Multivarite inverse logit functioninvmlogit
Check if number of whole numberis_whole_number
logLik function for SDE objectslogLik.HMM
Log of sum of exponentialslogsumexp
Make covariance matrix from standard deviations and correlationsmake_cov
Process formulas and store in nested listmake_formulas
Create model matricesmake_matrices
R6 class for HMM hidden process modelMarkovChain
Multivariate logit functionmlogit
Multivariate Normal inverse link functionmvnorm_invlink
Multivariate Normal link functionmvnorm_link
Fill in NAsna_fill
R6 class for HMM observation modelObservation
Get covariance matrix from precision matrixprec_to_cov
Solve for positive root of quadratic ax^2 + bx + c = 0 when it existsquad_pos_solve
Sample from a multivariate normal given its precision matrixrmvn_prec
Sample from von Mises distributionrvm
Sample from wrapped Cauchy distributionrwrpcauchy
Matern SPDE smoothPredict.matrix.spde.smooth smooth.construct.spde.smooth.spec
A length scale for the meshed domain, for starting valuesspde_extent
Observation locations for an SPDE smoothspde_loc
Default mesh for a one-dimensional SPDE smoothspde_mesh_1d
Strip comments marked with a hash from a character vectorstrip_comments
Update a model to a new model by changing one formulaupdate.HMM