⛰ Hidden Markovs Model's Foward Algorithm
The content of this repository served as an assignment project requested for the course Probabilistic Graphical Models at the INAOE as a student of the Master in Science in Computer Science. All the resources presented in the versions of this code were obtained from the class book that you can find in the references part.
This application of the algorithm and information was for an only educational purpose
Implement the Forward algorithm for estimating the probability of a sequence of observations given the model. The program should work for any discrete HMM and an observation sequence.Professor:
- PhD Enrique Sucar.
Student Involved:
- Mario De Los Santos. Github: MarSH-Up. Email: madlsh3517@gmail.com
Instructions
- Download the repository's file
- Verify that the C++ version is at least C++ 14
- Call the functions marked in the documentation
Example
To run in you would need 3 statements:
- Prior Probability Vector
- Transition Matrix
- Observation Matrix
- Sequences to look.
- The matrixes follow the next structure:
-
Prior Probability Vector: It's basically an array: π = S0,S1,S2, ..., S10
- The number of accepted states can be improved by modifying the px variable, right now delimited to 10 possibles states, Sn.
-
Transition Matrix: represents the cost of the transition between states.
-
Observation Matrix: represent the probability for each state to reach the given "status" The next image shows a basic example taken from the referenced book with the following information:
#References
- Sucar, L. E. (2020). Probabilistic graphical models. Advances in Computer Vision and Pattern Recognition.London: Springer London. doi, 10(978), 2