Hidden Markov Model-HMM-Summary-1-principle-Example

Source: Internet
Author: User

1. Brief Introduction

My understanding of Hidden Markov Model (HMM) is very limited. This article mainly takes the form of study notes.

2. Basic HMM principles

HMM is a double random process. To be precise, it is a set of two States and three matrices.
Two State sets: hidden state (S1, S2, S3,...) and observed state (O1, O2, O3 ,...). HMM assumes that the hidden state is A Markov chain, which corresponds to an initial State Matrix (P) and A state transition matrix (). Assume that the observed State is determined by the hidden state, that is, the confusion matrix (B ).
Generally, λ = (A, B, P) is used to represent A hidden Markov model. The Hidden Markov Model is actually an extension of the standard Markov model. It adds a set of observed states and the probability relationship between these States and hidden states.
Note: matrix A is A matrix that reflects the probability transfer between hidden states. That is, P (Si | Sj) indicates the probability from Sj to Si. matrix B is not necessarily A matrix, it reflects the known hidden state and the conditional probability of observing the State. That is, P (Oj | Si) indicates the probability from Si to Oj.

3. Simple HMM example

Suppose you have a friend who lives far away. He calls you every day to tell you what he did that day. Your friends are only interested in three types of activities: Park walking, shopping, and room cleaning. He chooses to do things only by the weather. He divides the weather into two types: "Rain" or "clear ".
HMM is used to model this typical example. The weather determines the activity of friends, so the weather status is hidden and the activity status is observation. This assumes that the weather conditions are Markov.
S = (rain, clear), O = (Park Walk, shopping, clean up the room), π is the matrix of 1*2, A is the matrix of 2*2, B is a matrix of 2*3. Corresponding Python code:

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 },
}

4. Summary

Just one point, HMM is A double random process, two sets, three matrices, S, O, A, B, P.

5. Reference

Http://baike.baidu.com/view/1174010.htm of Hidden Markov Model
Wikipedia _ Hidden Markov Model http://zh.wikipedia.org/wiki/%E9%9A%90%E9%A9%AC%E5%B0%94%E5%8F%AF%E5%A4% AB %E6%A8%A1%E5%9E%8B

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.