The forward algorithm (also forward algorithm , forward procedure ) uses so-called forward variables to calculate the probability of a specific observation for a given hidden Markov model . He uses the programming method of dynamic programming .
the initial distribution for the possible initial states,
designated.
Task and forward variables
Given a word . The forward algorithm now calculates the probability of actually making the observation in the existing model .
The forward variables are used for this. This stores the probability of having observed the prefix at the time and of being in the state :
functionality
The forward variables, and thus also the overall probability, can be calculated recursively:
initialization
Recursion
Termination
complexity
The algorithm requires operations and offers an efficient method for calculating the probability sought. The memory requirement lies in , since all are stored in a matrix to achieve the polynomial runtime .
If the intermediate results of for are not required after the end of the recursion, then the memory requirement is reduced to , since two column vectors of length are sufficient to store and in each recursion step.
Other uses
The forward variables are required together with the backward variables for the Baum-Welch algorithm to solve the learning problem given with hidden Markov models.
In addition, knowledge of this enables the determination of the probability of having been in the state when observing at a fixed point in time , because according to Bayes' theorem:
R. Durbin et al .: Biological sequence analysis. Probabilistic models of proteins and nucleic acids. 11th printing, corrected 10. reprinting . Cambridge University Press, Cambridge et al. 2006, ISBN 0-521-62971-3 , pp.59 .
Web links
EG Schukat-Talamazzini: Special pattern analysis systems (PDF, 1.3 MB) Lecture in WS 2012/13 at the University of Jena. Chapter 5 Slide 32ff.