Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for some simple Mathematica code to model an HMM with just a few states and an equal number of observable signals (emissions). I am hoping to generate sample paths and keep track of the posterior probability of the system being in a given state. Any help would be appreciated.

share|improve this question
Is this the sort of thing? – cormullion Jun 12 '13 at 14:33
Here's a tutorial on fitting hidden markov models in Mathematica including an example applied to financial data.… – bill s Jun 12 '13 at 14:49
@Tox If you want to simulate paths this might be useful. – Rod Jun 12 '13 at 15:08
This needs a v10 answer :) – Rojo Jul 13 '14 at 0:03

Mathematica V10 introduced the following two functions:

- HiddenMarkovProcess

- FindHiddenMarkovStates

Examples of their usage can be found here and here.

share|improve this answer

Thanks. I also found that there is a package with inbuilt functions, although super pricey, at

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.