Package: mHMMbayes 1.1.0

mHMMbayes: Multilevel Hidden Markov Models Using Bayesian Estimation

An implementation of the multilevel (also known as mixed or random effects) hidden Markov model using Bayesian estimation in R. The multilevel hidden Markov model (HMM) is a generalization of the well-known hidden Markov model, for the latter see Rabiner (1989) <doi:10.1109/5.18626>. The multilevel HMM is tailored to accommodate (intense) longitudinal data of multiple individuals simultaneously, see e.g., de Haan-Rietdijk et al. <doi:10.1080/00273171.2017.1370364>. Using a multilevel framework, we allow for heterogeneity in the model parameters (transition probability matrix and conditional distribution), while estimating one overall HMM. The model can be fitted on multivariate data with either a categorical, normal, or Poisson distribution, and include individual level covariates (allowing for e.g., group comparisons on model parameters). Parameters are estimated using Bayesian estimation utilizing the forward-backward recursion within a hybrid Metropolis within Gibbs sampler. Missing data (NA) in the dependent variables is accommodated assuming MAR. The package also includes various visualization options, a function to simulate data, and a function to obtain the most likely hidden state sequence for each individual using the Viterbi algorithm.

Authors:Emmeke Aarts [aut, cre], Sebastian Mildiner Moraga [aut]

mHMMbayes_1.1.0.tar.gz
mHMMbayes_1.1.0.zip(r-4.5)mHMMbayes_1.1.0.zip(r-4.4)mHMMbayes_1.1.0.zip(r-4.3)
mHMMbayes_1.1.0.tgz(r-4.4-x86_64)mHMMbayes_1.1.0.tgz(r-4.4-arm64)mHMMbayes_1.1.0.tgz(r-4.3-x86_64)mHMMbayes_1.1.0.tgz(r-4.3-arm64)
mHMMbayes_1.1.0.tar.gz(r-4.5-noble)mHMMbayes_1.1.0.tar.gz(r-4.4-noble)
mHMMbayes_1.1.0.tgz(r-4.4-emscripten)mHMMbayes_1.1.0.tgz(r-4.3-emscripten)
mHMMbayes.pdf |mHMMbayes.html
mHMMbayes/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/emmekeaarts/mhmmbayes/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • nonverbal - Nonverbal communication of patients and therapist
  • nonverbal_cov - Predictors of nonverbal communication

On CRAN:

6.61 score 17 stars 34 scripts 246 downloads 15 exports 14 dependencies

Last updated 8 months agofrom:5eb5520a09. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 21 2024
R-4.5-win-x86_64OKNov 21 2024
R-4.5-linux-x86_64OKNov 21 2024
R-4.4-win-x86_64OKNov 21 2024
R-4.4-mac-x86_64OKNov 21 2024
R-4.4-mac-aarch64OKNov 21 2024
R-4.3-win-x86_64OKNov 21 2024
R-4.3-mac-x86_64OKNov 21 2024
R-4.3-mac-aarch64OKNov 21 2024

Exports:int_to_probmHMMobtain_emissobtain_gammapd_RW_emiss_catpd_RW_emiss_countpd_RW_gammaprior_emiss_catprior_emiss_contprior_emiss_countprior_gammaprob_to_intsim_mHMMvar_to_logvarvit_mHMM

Dependencies:codalatticeMASSMatrixMatrixModelsmcmcMCMCpackmvtnormquantregrbibutilsRcppRdpackSparseMsurvival

Estimation of the multilevel hidden Markov model

Rendered fromestimation-mhmm.Rmdusingknitr::rmarkdownon Nov 21 2024.

Last update: 2024-04-01
Started: 2019-05-31

Multilevel HMM tutorial

Rendered fromtutorial-mhmm.Rmdusingknitr::rmarkdownon Nov 21 2024.

Last update: 2024-03-29
Started: 2019-05-31

Readme and manuals

Help Manual

Help pageTopics
Transforming a set of Multinomial logit regression intercepts to probabilitiesint_to_prob
Multilevel hidden Markov model using Bayesian estimationmHMM
Nonverbal communication of patients and therapistnonverbal
Predictors of nonverbal communicationnonverbal_cov
Obtain the emission distribution probabilities for a fitted multilevel HMMobtain_emiss
Obtain the transition probabilities gamma for a fitted multilevel HMMobtain_gamma
Proposal distribution settings RW Metropolis sampler for mHMM categorical emission distribution(s)pd_RW_emiss_cat
Proposal distribution settings RW Metropolis sampler for mHMM Poisson-lognormal emission distribution(s)pd_RW_emiss_count
Proposal distribution settings RW Metropolis sampler for mHMM transition probability matrix gammapd_RW_gamma
Plotting the posterior densities for a fitted multilevel HMMplot.mHMM
Plotting the transition probabilities gamma for a fitted multilevel HMMplot.mHMM_gamma
Specifying informative hyper-prior on the categorical emission distribution(s) of the multilevel hidden Markov modelprior_emiss_cat
Specifying informative hyper-prior on the continuous emission distribution(s) of the multilevel hidden Markov modelprior_emiss_cont
Specifying informative hyper-priors on the count emission distribution(s) of the multilevel hidden Markov modelprior_emiss_count
Specifying informative hyper-prior on the transition probability matrix gamma of the multilevel hidden Markov modelprior_gamma
Transforming a set of probabilities to Multinomial logit regression interceptsprob_to_int
Simulate data using a multilevel hidden Markov modelsim_mHMM
Transform the between-subject variance in the positive scale to the logvariance in the logarithmic scalevar_to_logvar
Obtain hidden state sequence for each subject using the Viterbi algorithmvit_mHMM