Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


finds the most likely hidden states of the HiddenMarkovProcess hmm corresponding to the emissions data.

uses the given criterion crit to find the hidden states.


  • FindHiddenMarkovStates is also known as hidden state decoding and Viterbi decoding.
  • The emissions data can be either a list or a TemporalData object.
  • FindHiddenMarkovStates returns the hidden state path in the same form as the emissions data. If there are multiple paths in data, there will be multiple state paths returned.
  • Possible values for criterion crit include:
  • "ViterbiDecoding"maximize likelihood for hidden state sequence (default)
    "PosteriorDecoding"maximize likelihood for hidden state at each time
  • Given an emission sequence , "ViterbiDecoding" maximizes the probability of a state sequence as a whole TemplateBox[{Probability, paclet:ref/Probability}, RefLink, BaseStyle -> {InlineFormula}][x(0)=i_0∧...∧x(n)=i_(n){y(0)=y_0,...,y(n)=y_(n)},...], whereas "PosteriorDecoding" maximizes the probability of a state value at each time TemplateBox[{Probability, paclet:ref/Probability}, RefLink, BaseStyle -> {InlineFormula}][x(t)=i{y(0)=y_0,...,y(n)=y_(n)},...].

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Suppose we observe the outputs from a fair (state 1) and unfair (state 2) coin:

Click for copyable input
Click for copyable input

Find the most likely sequence of coin changes from the observations:

Click for copyable input
Click for copyable input
Introduced in 2014