{
  "_id": "6a1f0ce9b401979e7341cf0c",
  "Package": "mHMMbayes",
  "Type": "Package",
  "Title": "Multilevel Hidden Markov Models Using Bayesian Estimation",
  "Version": "1.1.1",
  "Authors@R": "c(person(\"Emmeke\", \"Aarts\", email = \"e.aarts@uu.nl\",\nrole = c(\"aut\", \"cre\")),\nperson(\"Sebastian\", \"Mildiner Moraga\", role = \"aut\"))",
  "Maintainer": "Emmeke Aarts <e.aarts@uu.nl>",
  "Description": "An implementation of the multilevel (also known as mixed\nor random effects) hidden Markov model using Bayesian\nestimation in R. The multilevel hidden Markov model (HMM) is a\ngeneralization of the well-known hidden Markov model, for the\nlatter see Rabiner (1989) <doi:10.1109/5.18626>. The multilevel\nHMM is tailored to accommodate (intense) longitudinal data of\nmultiple individuals simultaneously, see e.g., de Haan-Rietdijk\net al. <doi:10.1080/00273171.2017.1370364>. Using a multilevel\nframework, we allow for heterogeneity in the model parameters\n(transition probability matrix and conditional distribution),\nwhile estimating one overall HMM. The model can be fitted on\nmultivariate data with either a categorical, normal, or Poisson\ndistribution, and include individual level covariates (allowing\nfor e.g., group comparisons on model parameters). Parameters\nare estimated using Bayesian estimation utilizing the\nforward-backward recursion within a hybrid Metropolis within\nGibbs sampler. Missing data (NA) in the dependent variables is\naccommodated assuming MAR. The package also includes various\nvisualization options, a function to simulate data, and a\nfunction to obtain the most likely hidden state sequence for\neach individual using the Viterbi algorithm.",
  "URL": "https://CRAN.R-project.org/package=mHMMbayes",
  "BugReports": "https://github.com/emmekeaarts/mHMMbayes/issues",
  "License": "GPL-3",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "RoxygenNote": "7.3.2",
  "VignetteBuilder": "knitr",
  "RdMacros": "Rdpack",
  "SystemRequirements": "GNU make",
  "Config/pak/sysreqs": "make",
  "Repository": "https://emmekeaarts.r-universe.dev",
  "Date/Publication": "2026-04-17 10:11:07 UTC",
  "RemoteUrl": "https://github.com/emmekeaarts/mhmmbayes",
  "RemoteRef": "HEAD",
  "RemoteSha": "666745ff24a9bbc34c3017e2123b56bb573b862e",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-05-17 09:18:20 UTC",
    "User": "root"
  },
  "Author": "Emmeke Aarts [aut, cre],\nSebastian Mildiner Moraga [aut]",
  "MD5sum": "10bf54d87667c37b9fa3b939fdc48255",
  "_user": "emmekeaarts",
  "_type": "src",
  "_file": "mHMMbayes_1.1.1.tar.gz",
  "_fileid": "69bb176004f5edfdd34c7872b8b232a56f95ea88bda889e4358ab0fc5a6c5454",
  "_filesize": 3181830,
  "_sha256": "69bb176004f5edfdd34c7872b8b232a56f95ea88bda889e4358ab0fc5a6c5454",
  "_created": "2026-05-17T09:18:20.000Z",
  "_published": "2026-06-02T17:03:37.141Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 79127243638,
      "time": 164,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7041172482"
    },
    {
      "job": 79127244034,
      "time": 178,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7041174073"
    },
    {
      "job": 79127244214,
      "time": 173,
      "config": "linux-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041173406"
    },
    {
      "job": 79127244439,
      "time": 174,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041173594"
    },
    {
      "job": 79127244427,
      "time": 168,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7041170226"
    },
    {
      "job": 79127244306,
      "time": 351,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7041189779"
    },
    {
      "job": 79127244282,
      "time": 217,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041173793"
    },
    {
      "job": 79127243788,
      "time": 284,
      "config": "macos-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041182329"
    },
    {
      "job": 79127243078,
      "time": 207,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041154898"
    },
    {
      "job": 79127243068,
      "time": 121,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7364547301"
    },
    {
      "job": 79127243517,
      "time": 173,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7041173299"
    },
    {
      "job": 79127244366,
      "time": 149,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7041170844"
    },
    {
      "job": 79127243704,
      "time": 154,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7041171286"
    }
  ],
  "_buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/emmekeaarts/mhmmbayes",
  "_commit": {
    "id": "666745ff24a9bbc34c3017e2123b56bb573b862e",
    "author": "emmekeaarts <e.aarts@uu.nl>",
    "committer": "emmekeaarts <e.aarts@uu.nl>",
    "message": "release\n",
    "time": 1776420667
  },
  "_maintainer": {
    "name": "Emmeke Aarts",
    "email": "e.aarts@uu.nl",
    "login": "emmekeaarts",
    "description": "",
    "uuid": 39554822
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.6.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "MCMCpack",
      "role": "Imports"
    },
    {
      "package": "mvtnorm",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "Rdpack",
      "role": "Imports"
    },
    {
      "package": "Rcpp",
      "role": "Imports"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "alluvial",
      "role": "Suggests"
    },
    {
      "package": "grDevices",
      "role": "Suggests"
    },
    {
      "package": "RColorBrewer",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 2.1.0",
      "role": "Suggests"
    }
  ],
  "_owner": "emmekeaarts",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-28",
      "n": 9
    },
    {
      "week": "2026-16",
      "n": 1
    }
  ],
  "_tags": [],
  "_stars": 26,
  "_contributors": [
    {
      "user": "emmekeaarts",
      "count": 441,
      "uuid": 39554822
    },
    {
      "user": "smildiner",
      "count": 42,
      "uuid": 12476519
    }
  ],
  "_userbio": {
    "uuid": 39554822,
    "type": "user",
    "name": "Emmeke Aarts"
  },
  "_downloads": {
    "count": 220,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/mHMMbayes"
  },
  "_devurl": "https://github.com/emmekeaarts/mhmmbayes",
  "_searchresults": 114,
  "_topics": [
    "cpp"
  ],
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/mHMMbayes.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/emmekeaarts/mhmmbayes",
  "_realowner": "emmekeaarts",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2019-10-25"
    },
    {
      "version": "0.1.1",
      "date": "2019-10-30"
    },
    {
      "version": "0.2.0",
      "date": "2022-08-17"
    },
    {
      "version": "1.0.0",
      "date": "2023-10-02"
    },
    {
      "version": "1.1.0",
      "date": "2024-04-01"
    },
    {
      "version": "1.1.1",
      "date": "2025-07-11"
    }
  ],
  "_exports": [
    "int_to_prob",
    "mHMM",
    "obtain_emiss",
    "obtain_gamma",
    "pd_RW_emiss_cat",
    "pd_RW_emiss_count",
    "pd_RW_gamma",
    "prior_emiss_cat",
    "prior_emiss_cont",
    "prior_emiss_count",
    "prior_gamma",
    "prob_to_int",
    "sim_mHMM",
    "var_to_logvar",
    "vit_mHMM"
  ],
  "_datasets": [
    {
      "name": "nonverbal",
      "title": "Nonverbal communication of patients and therapist",
      "object": "nonverbal",
      "class": [
        "matrix",
        "array"
      ],
      "fields": [
        "id",
        "p_vocalizing",
        "p_looking",
        "t_vocalizing",
        "t_looking"
      ],
      "rows": 9000,
      "table": true,
      "tojson": true
    },
    {
      "name": "nonverbal_cov",
      "title": "Predictors of nonverbal communication",
      "object": "nonverbal_cov",
      "class": [
        "data.frame"
      ],
      "fields": [
        "diagnosis",
        "std_CDI_change",
        " std_SCA_change"
      ],
      "rows": 10,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "int_to_prob",
      "title": "Transforming a set of Multinomial logit regression intercepts to probabilities",
      "topics": [
        "int_to_prob"
      ]
    },
    {
      "page": "mHMM",
      "title": "Multilevel hidden Markov model using Bayesian estimation",
      "topics": [
        "mHMM"
      ]
    },
    {
      "page": "nonverbal",
      "title": "Nonverbal communication of patients and therapist",
      "topics": [
        "nonverbal"
      ]
    },
    {
      "page": "nonverbal_cov",
      "title": "Predictors of nonverbal communication",
      "topics": [
        "nonverbal_cov"
      ]
    },
    {
      "page": "obtain_emiss",
      "title": "Obtain the emission distribution probabilities for a fitted multilevel HMM",
      "topics": [
        "obtain_emiss"
      ]
    },
    {
      "page": "obtain_gamma",
      "title": "Obtain the transition probabilities gamma for a fitted multilevel HMM",
      "topics": [
        "obtain_gamma"
      ]
    },
    {
      "page": "pd_RW_emiss_cat",
      "title": "Proposal distribution settings RW Metropolis sampler for mHMM categorical emission distribution(s)",
      "topics": [
        "pd_RW_emiss_cat"
      ]
    },
    {
      "page": "pd_RW_emiss_count",
      "title": "Proposal distribution settings RW Metropolis sampler for mHMM Poisson-lognormal emission distribution(s)",
      "topics": [
        "pd_RW_emiss_count"
      ]
    },
    {
      "page": "pd_RW_gamma",
      "title": "Proposal distribution settings RW Metropolis sampler for mHMM transition probability matrix gamma",
      "topics": [
        "pd_RW_gamma"
      ]
    },
    {
      "page": "plot.mHMM",
      "title": "Plotting the posterior densities for a fitted multilevel HMM",
      "topics": [
        "plot.mHMM"
      ]
    },
    {
      "page": "plot.mHMM_gamma",
      "title": "Plotting the transition probabilities gamma for a fitted multilevel HMM",
      "topics": [
        "plot.mHMM_gamma"
      ]
    },
    {
      "page": "prior_emiss_cat",
      "title": "Specifying informative hyper-prior on the categorical emission distribution(s) of the multilevel hidden Markov model",
      "topics": [
        "prior_emiss_cat"
      ]
    },
    {
      "page": "prior_emiss_cont",
      "title": "Specifying informative hyper-prior on the continuous emission distribution(s) of the multilevel hidden Markov model",
      "topics": [
        "prior_emiss_cont"
      ]
    },
    {
      "page": "prior_emiss_count",
      "title": "Specifying informative hyper-priors on the count emission distribution(s) of the multilevel hidden Markov model",
      "topics": [
        "prior_emiss_count"
      ]
    },
    {
      "page": "prior_gamma",
      "title": "Specifying informative hyper-prior on the transition probability matrix gamma of the multilevel hidden Markov model",
      "topics": [
        "prior_gamma"
      ]
    },
    {
      "page": "prob_to_int",
      "title": "Transforming a set of probabilities to Multinomial logit regression intercepts",
      "topics": [
        "prob_to_int"
      ]
    },
    {
      "page": "sim_mHMM",
      "title": "Simulate data using a multilevel hidden Markov model",
      "topics": [
        "sim_mHMM"
      ]
    },
    {
      "page": "var_to_logvar",
      "title": "Transform the between-subject variance in the positive scale to the logvariance in the logarithmic scale",
      "topics": [
        "var_to_logvar"
      ]
    },
    {
      "page": "vit_mHMM",
      "title": "Obtain hidden state sequence for each subject using the Viterbi algorithm",
      "topics": [
        "vit_mHMM"
      ]
    }
  ],
  "_readme": "https://github.com/emmekeaarts/mhmmbayes/raw/HEAD/README.md",
  "_rundeps": [
    "coda",
    "lattice",
    "MASS",
    "Matrix",
    "MatrixModels",
    "mcmc",
    "MCMCpack",
    "mvtnorm",
    "quantreg",
    "rbibutils",
    "Rcpp",
    "Rdpack",
    "SparseM",
    "survival"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "14.2.0-4ubuntu2~24.04.1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_vignettes": [
    {
      "source": "estimation-mhmm-html.Rmd",
      "filename": "estimation-mhmm-html.html",
      "title": "Estimation of the multilevel hidden Markov model",
      "author": "Emmeke Aarts",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Estimating the parameters of the HMM",
        "Maximum likelihood (ML)",
        "Expectation Maximization (EM) or Baum-Welch algorithm",
        "Bayesian estimation",
        "Estimating the parameters of the multilevel HMM",
        "Bayesian estimation of multilevel models",
        "Multilevel model for the state-dependent probabilities $\\boldsymbol{\\theta}_{ki}$",
        "Multilevel model for the transition probability matrix $\\boldsymbol{\\Gamma_k}$ with transition probabilities $\\boldsymbol{\\gamma_{kij}}$",
        "Hybrid Metropolis within Gibbs sampler used to fit the multilevel HMM",
        "Stepwise walkthrough of the used hybrid Metropolis within Gibbs sampler",
        "Scaling the proposal distribution of the RW Metropolis sampler",
        "Full conditional posterior distributions of the multilevel HMM",
        "References"
      ],
      "created": "2025-07-11 12:40:10",
      "modified": "2025-07-11 12:40:10",
      "commits": 1
    },
    {
      "source": "tutorial-mhmm.Rmd",
      "filename": "tutorial-mhmm.html",
      "title": "Multilevel HMM tutorial",
      "author": "Emmeke Aarts",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Hidden Markov models",
        "Multilevel hidden Markov models",
        "Using the package mHMMbayes",
        "A simple model",
        "Starting values",
        "Prior distributions",
        "Fitting the model",
        "Graphically displaying outcomes",
        "Determining the number of hidden states",
        "Determining the most likely state sequence",
        "Checking model convergence and label switching",
        "References"
      ],
      "created": "2019-05-31 14:53:09",
      "modified": "2025-07-11 12:40:10",
      "commits": 18
    }
  ],
  "_score": 6.772908194971272,
  "_indexed": true,
  "_nocasepkg": "mhmmbayes",
  "_universes": [
    "emmekeaarts"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:30.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "2acaa395b48f1e4853d0c727bcfb4f510e0173f42b997982531241bfd32a00c7",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:37.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "d8c6f50b340e8521f50e6479f9f6a0f8a21cb502721cf67fa54c64b44b11a1fa",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:38.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "1416351c66b19bcd79c1aa54926f438ebaca305672ee2efe767d1cd0cfb50099",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:35.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "6e055d70eb252ce180e9cd9e32521ae00d633167303509903bbb4287b0241ea4",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:29.000Z",
      "arch": "aarch64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "900f981716fbf79991923373ca91a785ba69676afa74a6b419ed3620bec68f1e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.1",
      "date": "2026-05-17T09:22:28.000Z",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "64a8532aa37d94cc7fb3e4fe7bb76b8e79e673df6c2e1c68e6032730efabad60",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.1",
      "date": "2026-05-17T09:20:45.000Z",
      "arch": "aarch64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "47ebebff4b090c02c0d454594dd931183dee6ae66c2f70cbaa46ae4065244038",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.1",
      "date": "2026-05-17T09:21:28.000Z",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "7bcb071cad2be0f58ed3b04fd413a08f59db291013830afdbf5b5d62067837bc",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.1.1",
      "date": "2026-05-17T09:19:54.000Z",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "c4a7292d36069ff3f76e305b288b9a7c3c91b200aab15a306149aa29ab111d5d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.1.1",
      "date": "2026-05-17T09:19:39.000Z",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "562c41aa28c0e7822c175b9ee2af7d328ea1eef02cd93221a1bd9deabe8621eb",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.1.1",
      "date": "2026-05-17T09:19:37.000Z",
      "arch": "x86_64",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "e71d59d0562ce63ae4fa0348515656dc5501aa3447721026be6105acda081f98",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.1.1",
      "date": "2026-06-02T17:03:05.000Z",
      "arch": "emscripten",
      "commit": "666745ff24a9bbc34c3017e2123b56bb573b862e",
      "fileid": "1b9d4907217ff02f2b9477bc1ae6ec8508b3abd053b938e58d703a107c5787b8",
      "status": "success",
      "buildurl": "https://github.com/r-universe/emmekeaarts/actions/runs/25986835343"
    }
  ]
}