Data: ( O 1 , O 2 , , O n ) set of observations

Initialization

θ 0

( a i j ) Matrix of transition

p i l Weight of the l mixture component of state i,

μ i l Mean vector of the l mixture component of state i,

σ i l Covariance matrix of the l mixture component of state i.

Forward ( O 1 , O 2 , , O n ) ,

Backward ( O 1 , O 2 , , O n ) .

While log ( P ( O 1 , O 2 , , O n ) ) p 0 (fixed threshold)

Expectation ξ t ( i , j ) = P ( s t = i , s t + 1 = j / 0 , θ ) ,

γ t ( i ) = P ( s t = i / O , θ ) = j ξ ( i , j ) ,

γ i l ( t ) = P ( S t = i , m = l / O t , θ ) = γ i ( t ) p i l P ( O t / μ i l , σ i l , θ ) P ( O t / S t = i , θ ) .

Maximization a i j = t = 1 T ξ t ( i , j ) t = 1 T γ t ( i ) ,

p i l = t = 1 T γ i l ( t ) O t t = 1 T γ i l ( t ) ,

σ i l = t = 1 T γ i l ( t ) ( O t μ i l ) ( O t μ i l ) T t = 1 T γ i l ( t ) .

End While

f j ( O t + 1 ) : density of probability of the state i,

γ i l ( t ) : probability that the component l of the state i generated the observation at time t,

γ i ( t ) : probability that the state i generated the observation at time t.