stan-dev / stan-dev/math

Allowing changing transition matrix for hmm suites

Open
#2,678 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature good first issue
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

Currently we only allow users to pass a fix transition matrix when calling any one of three functions for Hidden Markov Models:

  • hmm_marginal
  • hmm_hidden_state_prob
  • hmm_latent_rng

In some models, the user needs to pass a transition matrix that changes over (discrete) time. To accommodate this, we need to revise the code so that it can handle an array of transition matrices, where the number of matrices is K (the number of unobserved discrete variables).

Example

See this discussion on the Stan forum.

Expected Output

Overload all signatures for hmm functions so that they can accept an array of transition matrices, rather than a single transition matrix.

Current Version:

v4.3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the implementations and overloads for hmm_marginal, hmm_hidden_state_prob, and hmm_latent_rng, then trace how each currently accepts a fixed transition matrix. Update the signatures and behavior to accept K time-varying transition matrices, and verify that all three HMM functions support the expected array form.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.