hmmtmb

Fit hidden Markov models using Template Model Builder (TMB): flexible state-dependent distributions, transition probability structures, random effects, and smoothing splines.

https://github.com/theomichelot/hmmtmb

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, wiley.com
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary

Keywords

hidden-markov-model hmm mixed-effects-models r-package random-effects smoothing-splines time-series-analysis
Last synced: 6 months ago · JSON representation

Repository

Fit hidden Markov models using Template Model Builder (TMB): flexible state-dependent distributions, transition probability structures, random effects, and smoothing splines.

Basic Info
  • Host: GitHub
  • Owner: TheoMichelot
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 17.6 MB
Statistics
  • Stars: 56
  • Watchers: 8
  • Forks: 9
  • Open Issues: 4
  • Releases: 0
Topics
hidden-markov-model hmm mixed-effects-models r-package random-effects smoothing-splines time-series-analysis
Created about 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog

README.md

hmmTMB

This R package implements flexible hidden Markov models, based on Template Model Builder (TMB): flexible state-dependent distributions, transition probability structures, random effects, and smoothing splines.

Preprint

The statistical background, as well as details about the implementation of the package, and several example analyses, are presented in the following preprint.

Michelot, T. (2022). hmmTMB: Hidden Markov models with flexible covariate effects in R. arXiv:2211.14139.

Package installation

The package is available on CRAN, and the stable version can therefore be installed using install.packages("hmmTMB")

The development version of the package can be installed from Github using devtools, devtools::install_github("TheoMichelot/hmmTMB")

Package documentation

To find help files for the methods implemented in the package, search for help using the name of the corresponding class, e.g., ?MarkovChain ?Observation ?HMM

We describe functionalities of the package in several vignettes, which are listed below.

Main vignette

Other features

  • 'Bayesian inference in hmmTMB': Description of workflow for Bayesian analysis in hmmTMB, including specifying priors, and extracting posterior samples.

  • 'Advanced features of hmmTMB': Description of some other useful functionalities, including (semi-)supervised learning, parameter constraints, selection of initial parameter values, etc.

  • 'General dependence structures in hmmTMB': Implementation details for hidden Markov models (HMMs) with non-standard dependence structures, including hidden semi-Markov models, higher-order HMMs, autoregressive HMMs, and coupled HMMs.

Case studies

  • 'Flexible animal movement modelling using hmmTMB': Description of wild haggis movement analysis, illustrating how non-parametric covariate effects can be included. This includes two different types of movement models: (1) correlated random walks based on step lengths and turning angles, and (2) correlated random walks based on locations directly.

  • 'Occupancy modelling using hmmTMB': Analysis of occupancy data set of crossbill from Kéry et al. (2013).

  • 'The categorical distribution in hmmTMB': The categorical distribution is slightly different from others, in that the number of parameters depends on the data (specifically, on the number of categories in the data). This vignette shows an example analysis for a data set on patient-therapist interactions from the mHMMbayes package.

    • 'The multivariate normal distribution in hmmTMB': We illustrate the state-dependent multivariate normal distribution for modelling correlated variables, using time series of log-returns. The vignette describes the formulation in terms of standard deviations and correlation parameters, and compares this approach to using multiple univariate normal distributions.

Reference vignettes

  • 'List of distributions in hmmTMB': List of observation distributions currently available in hmmTMB.

  • 'Adding new distributions in hmmTMB': Technical vignette about adding new observation distributions to hmmTMB, with detailed instructions to add the required R and C++ code.

  • 'Syntax of model formulas in hmmTMB': Flexible covariate dependence can be specified using the syntax of mgcv formulas, and this vignette describes a few special cases, including random effects (intercepts or slopes), smooth non-linear relationships, factor-smooth interactions, multidimensional smooths, varying-coefficient models, cyclical effects, etc.

  • 'HMM package comparison': Comparison of syntax between several R packages (hmmTMB, momentuHMM, depmixS4, LMest) and a Python package (hmmlearn) for a simple 2-state Gaussian HMM.

Owner

  • Name: Théo Michelot
  • Login: TheoMichelot
  • Kind: user
  • Location: Halifax
  • Company: Dalhousie University

Assistant professor in statistics at Dalhousie University, Halifax, Canada

GitHub Events

Total
  • Issues event: 2
  • Watch event: 4
  • Push event: 17
  • Pull request event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 2
  • Watch event: 4
  • Push event: 17
  • Pull request event: 1
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Fork event: 2
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 714
  • Total Committers: 4
  • Avg Commits per committer: 178.5
  • Development Distribution Score (DDS): 0.588
Top Committers
Name Email Commits
Théo Michelot t****5@s****k 294
Theo Michelot t****t@g****m 272
richard g****e@g****k 147
Brett McClintock b****k@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 22
  • Total pull requests: 2
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 20 hours
  • Total issue authors: 5
  • Total pull request authors: 2
  • Average comments per issue: 1.91
  • Average comments per pull request: 0.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • TheoMichelot (11)
  • r-glennie (5)
  • roaldarbol (4)
  • orijitghosh (1)
  • Beliavsky (1)
  • RonEfrat (1)
Pull Request Authors
  • DuncanCSt (2)
  • bmcclintock (1)
Top Labels
Issue Labels
bug (4) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 351 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: hmmTMB

Fit Hidden Markov Models using Template Model Builder

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 351 Last month
Rankings
Stargazers count: 9.0%
Forks count: 10.1%
Average: 29.5%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 63.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R6 * depends
  • RcppEigen * depends
  • TMB * depends
  • ggplot2 * depends
  • mgcv * depends
  • Matrix * imports
  • optimx * imports
  • stringr * imports
  • CircStats * suggests
  • rstan * suggests
  • testthat * suggests
  • tmbstan * suggests