# How to marginalized Hidden Markov Model with categorical?

**URL:** <https://discourse.pymc.io/t/how-to-marginalized-hidden-markov-model-with-categorical/2230>\
**Category:** Questions\
**Created:** [November 17, 2018, 5:55pm UTC](https://discourse.pymc.io/t/how-to-marginalized-hidden-markov-model-with-categorical/2230 "2018-11-17T17:55:46Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [December 10, 2018, 11:10am UTC](https://discourse.pymc.io/t/how-to-marginalized-hidden-markov-model-with-categorical/2230/9 "2018-12-10T11:10:35Z")

</div>

FYI, I implemented the forward algorithm using `theano.scan`, notebook here: [https://github.com/junpenglao/Planet\_Sakaar\_Data\_Science/blob/master/PyMC3QnA/discourse\_2230.ipynb](https://github.com/junpenglao/Planet_Sakaar_Data_Science/blob/master/PyMC3QnA/discourse_2230.ipynb)

Observation:

- unsupervised model is super unidentifiable
- semi-supervised model seems to perform quite well

@nmrobert, do you see similar result in Stan?

---

_[View the full topic](https://discourse.pymc.io/t/how-to-marginalized-hidden-markov-model-with-categorical/2230)._
