Thanks again, @bob-carpenter.
How is q_0 generated?
q_0 is known deterministically. That is, in the experiment that generates the data, I get to choose if q_0 is either 0 or 1.
I’m a little unclear on the
V_idistribution—what isE[q_i]and what is observed. I was confused by theV_ibeing labeled as “observed emissions” and then observed actually showing up.
Apologies for the inconsistent notation. E is a 2x2 emission matrix. For instance, E = [[.05,.95],[.95,.05]] such that if q_i=1, then we sample V_i ~ pm.Categorical.dist(p=E[q_i]) = pm.Categorical.dist(p=[.95,.05]). And then that sampled value of V_i gets compared against the observed data X_i (the observed data has values of either 0 or 1).
… you definitely do not want to be doing discrete sampling here following the generative model (there’s usually way too much correlation among states).
OK, perhaps I’ll drop the markov_chain() sampling and implement a forward-algorithm likelihood following Example: Hidden Markov Model — NumPyro documentation or How to marginalized Hidden Markov Model with categorical? - #9 by junpenglao (which links to Planet_Sakaar_Data_Science/PyMC_QnA/discourse_2230.ipynb at main · junpenglao/Planet_Sakaar_Data_Science · GitHub).