Hidden Markov model

   

A hidden Markov model (HMM) is a statistical model where the system being modelled is assumed to be a Markov process with unknown parameters, and the challenge is to determine the hidden parameters, from the observable parameters, based on this assumption. The extracted model parameters can then be used to perform further analysis, for example for pattern recognition applications.

In a regular Markov model, the state is directly visible to the observer, and therefore the state transition probabilities are the only parameters. A hidden Markov model adds outputs: each state has a probability distribution over the possible output tokens. Therefore, looking at a sequence of tokens generated by an HMM does not directly indicate the sequence of states.

State transitions in a hidden Markov model

Markov Model Example. - x — States of the Markov model - a — Transition probabilities - b — Output probabilities - y — Observable outputs
Enlarge
Markov Model Example.
- x — States of the Markov model
- a — Transition probabilities
- b — Output probabilities
- y — Observable outputs


Evolution of a Markov model

The preceding diagram emphasizes the state transitions of a hidden Markov model. It is also useful to explicitly represent the evolution of the model over time, with the states at different times t1 and t2 represented by different variables, x(t1) and x(t2).

Temporal evolution of a hidden Markov model

In this diagram, it is understood that the time slices (x(t), y(t)) extend to previous and following times as needed. Typically the earliest slice is at time t=0 or time t=1.

Using Markov models

There are 3 canonical problems to solve with HMMs:

  • Given the model parameters, compute the probability of a particular output sequence. Solved by the forward algorithm.
  • Given the model parameters, find the most likely sequence of (hidden) states which could have generated a given output sequence. Solved by the Viterbi algorithm.
  • Given an output sequence, find the most likely set of state transition and output probabilities. Solved by the Baum-Welch algorithm.

A concrete example

Assume you have a friend who lives far away and who you call daily to talk about what each of you did that day. Your friend has only three things he's interested in: walking in the park, shopping, and cleaning his apartment. The choice of what to do is determined exclusively by the weather on a given day. You have no definite information about the weather where your friend lives, but you know general trends. Based on what he tells you he did each day, you try to guess what the weather must have been like.

You believe that the weather operates as a discrete Markov chain. There are two states, "Rainy" and "Sunny", but you cannot observe them directly, that is, they are hidden from you. On each day, there is a certain chance that your friend will perform one of the following activities, depending on the weather: "walk", "shop", or "clean". Since your friend tells you about his activities, those are the observations. The entire system is that of a hidden Markov model (HMM).

You know the general weather trends in the area and you know what your friend likes to do on average. In other words, the parameters of the HMM are known. In fact, you can write them down in the Python programming language:

states = ('Rainy', 'Sunny')

observations = ('walk', 'shop', 'clean')

start_probability = {'Rainy': 0.6, 'Sunny': 0.4}

transition_probability = {
   'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3},
   'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6},
   }

emission_probability = {
   'Rainy' : {'walk': 0.1, 'shop': 0.4, 'clean': 0.5},
   'Sunny' : {'walk': 0.6, 'shop': 0.3, 'clean': 0.1},
   }

In this fragment, start_probability refers to your uncertainty about which state the HMM is in when your friend first calls you (all you know is that it tends to be rainy on average). The transition_probability refers to the change of the weather in the underlying Markov chain. In this example, there is only a 30% chance that tomorrow will be sunny if today is rainy. The emission_probability tells you how likely your friend is to perform a certain activity on each day. If it's rainy, there is a 50% chance that he is cleaning his apartment; if it's sunny, there is a 60% chance that he will go outside for a walk.

This example is further elaborated in Viterbi algorithm page

Applications of hidden Markov models

See also

References

External links

  • Hidden Markov Models (http://www.cs.brown.edu/research/ai/dynamics/tutorial/Documents/HiddenMarkovModels.html) (an exposition using basic mathematics)
  • GHMM Library (http://www.ghmm.org) (home page of the GHMM Library project)


de:Hidden Markov Model ja:隠れマルコフモデル

Retrieved from "http://www.mywiseowl.com/articles/Hidden_Markov_model"

This page has been accessed 997 times. This page was last modified 14:11, 14 Nov 2004. All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).