Docsity

Hidden Markov Model - Lecture Notes | STAT 597A, Study notes of Statistics

Partial preview of the text

Download Hidden Markov Model - Lecture Notes | STAT 597A and more Study notes Statistics in PDF only on Docsity!

Hidden Markov Model

Jia Li

Department of Statistics The Pennsylvania State University

Email: [email protected] http://www.stat.psu.edu/∼jiali

Hidden Markov Model

I (^) Hidden Markov models have close connection with mixture models. I (^) A mixture model generates data as follows.

Model Setup

I (^) Suppose we have a sequential data u = {u 1 , u 2 , ..., ut , ..., uT }, ut ∈ Rd^. I (^) As in the mixture model, every ut , t = 1, ..., T , is generated by a hidden state, st.

I (^) The underlying states follow a Markov chain. I (^) Given present, the future is independent of the past:

P(st+1 | st , st− 1 , ..., s 0 ) = P(st+1 | st ). I (^) Transition probabilities:

ak,l = P(st+1 = l | st = k) ,

k, l = 1, 2 , ..., M, where M is the total number of states. Initial probabilities of states: πk.

∑^ M l=

ak,l = 1 for any k ,

∑^ M k=

πk = 1.

I (^) Given state k, the probability law of U is specified by bk (u). I (^) Discrete: suppose U takes finitely many possible values, bk (u) is specified by the pmf (probability mass function). I (^) Continuous: most often the Gaussian distribution is assumed.

bk (u) = √^1 (2π)d^ |Σk |

exp(− 1 2 (u − μk )t^ Σ− k 1 (u − μk ))

I (^) In summary:

P(u, s) = P(s)P(u | s) = πs 1 bs 1 (u 1 )as 1 ,s 2 bs 2 (u 2 ) · · · asT − 1 ,sT bsT (uT ).

P(u) =

s

P(s)P(u | s) total prob. formula

s

πs 1 bs 1 (u 1 )as 1 ,s 2 bs 2 (u 2 ) · · · asT − 1 ,sT bsT (uT )

I (^) For a computer program, the states are unknown. Only features can be extracted for each frame. The features are the observation, which can be organized into a vector. I (^) The goal is to figure out the state sequence given the observed sequence of feature vectors. I (^) We expect the probability distribution of the feature vector to differ according to the state. However, these distributions may overlap, causing classification errors.

I (^) By using the dependence among states, we may make better guesses of the states than guessing each state separately using only the feature vector of that frame.

Model Estimation

I (^) Parameters involved: I (^) Transition probabilities: ak,l , k, l = 1, ..., M. I (^) Initial probabilities: πk , k = 1, ..., M. I (^) For each state k, μk , Σk.

I (^) Maximum likelihood estimation by EM: I (^) E step: Under the current set of parameters, compute Lk (t) and Hk,l (t), for k, l = 1, ..., M, t = 1, ..., T. I (^) M step: Update parameters.

μk =

∑T ∑t=1^ Lk^ (t)ut T t=1 Lk^ (t)

Σk =

∑T t=1 Lk^ (t ∑)(ut^ −^ μk^ )(ut^ −^ μk^ )t T t=1 Lk^ (t)

ak,l =

∑T − 1 ∑^ t=1^ Hk,l^ (t) T − 1 t=1 Lk^ (t)^

.

I (^) Note: the initial probabilities of states πk are often manually determined. We can also estimate them by

πk ∝

∑^ T

t=

Lk (t) ,

∑^ M

k=

πk = 1

or πk ∝ Lk (1)

I (^) The posterior probabilities pt,k in the mixture model can be determined using only sample ut because of the independent sample assumption. I (^) Lk (t) depends on the entire sequence because of the underlying Markov process. I (^) For a mixture model, we have

μk =

∑T

∑t=1^ pt,k^ ut T t=1 pt,k

Σk =

∑T

t=1 pt,k^ (ut^ −^ μk^ )(ut^ −^ μk^ ) t ∑T t=1 pt,k

Derivation from EM

I (^) The incomplete data are u = {ut : t = 1, ..., T }. The complete data are x = {st , ut : t = 1, ..., T }. I (^) Note Q(θ′|θ) = E (log(f (x|θ′))|u, θ). I (^) Let M = { 1 , 2 , ..., M}.

E (log f (x | θ′)|u, θ)

=

s

P(s|u, θ)

[

log(π′ s 1 ) +

∑^ T

t=

log a′ st− 1 ,st +

∑^ T

t=

log P(ut | μ′ st , Σ′ st )

]

∑^ M

k=

Lk (1) log(π′ k ) +

∑^ T

t=

∑^ M

k=

∑^ M

l=

Hk,l (t) log a k′,l

∑^ T

t=

∑^ M

k=

Lk (t) log P(ut | μ′ k , Σ′ k )

I (^) Prove the equality of the second term

∑

s

P(s|u, θ)

∑^ T

t=

log a′ st− 1 ,st

∑^ T

t=

∑^ M

k=

∑^ M

l=

Hk,l (t) log a′ k,l

Similar proof applies to the equality corresponding to other terms.