Http://www.comp.leeds.ac.uk/roger/HiddenMarkovModels/html_dev/forward_algorithm/s1_pg1.html
Section 1Finding the probability of an observed sequence
1. Exhaustive search for solutionGiven hmm, the probability of observed sequence is to be found. In the weather model, we have a HMM that describes the relationship between weather and weather and seaweed states. If the seaweed state is observed for 3 consecutive days (dry, damp, soggy), then the relationship between observations and hidden states can be plotted as a lattice property trellis: The probability between adjacent column columns is determined by Tran Sition matrix determines that the probability of the observation below each column under different hidden states (i.e. weather) is determined by the confusion matrix. In order to calculate PR (dry, damp, soggy), one method is: PR (dry,damp,soggy | HMM) = PR (Dry,damp,soggy | sunny,sunny,sunny) + PR (dry,damp,soggy | sunny,sunny, Cloudy) + PR (dry,damp,soggy | sunny,sunny , rainy) + .... Pr (Dry,damp,soggy | rainy,rainy, rainy) The calculation here is quite cumbersome and can be simplified by using the probability of time invariance (temporal invariance of the probabilities).
2. Reduction of compleity using recursionSuppose T-long observed sequence is
2a. Partial probabilities, (a ' s alpha ' s)The probability of reaching each intermediate state, is the probability of all paths and. For example: at (j): Partial probability of the state J at Time Tat (j) = PR (Observation | Hiden State was j) * PR (All paths to state J at Time t)
The last observation (observation) represents the probability of reaching these states through all possible paths, and for the above example, the final partial probabilities is calculated as follows:
2b. Calculating a ' s at time T=1t = 1 o'clock, there is no path to this state, so the Pr (state | t = 1) =π, so
The probability that the initial state is in J depends on the probability of State j, and the probability of the observed state.
2c. Calculating a ' s at time t>1
Assuming that the first state is known, consider the second Pr (all paths to States J at time T). This can be calculated by calculating the probability of each path, and then adding and.
The number of paths increases exponentially with the growth of the observed sequence, which can be computed by at-1:
2d. Reduction of computational complexityFor an observation sequence of length T, its HMM has n hidden states, l= (π, A, B). The traversal method, the complexity is the number of degrees, but through the forward algorithm, using the results of the previous calculation to calculate a new value, the phase complexity is the linear level of T. Section 2Forward algorithm definition uses the forward algorithm to calculate the probability of a T-length observation sequence:
Y represents the element in the observable set.
The probability in the middle can be calculated recursively using A1 (J). For T > 1, the probability of the observed sequence can be calculated recursively: the sum of the probabilities of all the partial probabilities.
For the weather example, t=2, a for the probability of the cloudy state is calculated as follows:
The second of the HMM series: Forward algorithm