Skip to content

Latest commit

 

History

History
43 lines (22 loc) · 1.75 KB

README.md

File metadata and controls

43 lines (22 loc) · 1.75 KB

Viterbi Algorithm for Hidden Markov Models

A MATLAB implementation of the Viterbi Algorithm for training Hidden Markov Models.

Fifth Assignment for Probabilistic Models for Decisions course @ Unimib 18/19.

Example

Consider the following HMM:

  • Initial probability distribution (for example states: climb, not climb)

  • Transition probability matrix (again states: climb, not climb)

    This is the rendered form of the equation. You can not edit this directly. Right click will give you the option to save the image, and in most browsers you can drag the image onto your desktop or another program.

  • Emission probability matrix (for example observations: injury, not injury)

Given a sequence of observation, for example E = {not injury, injury, not injury}, this implementation of the Viterbi algorithm computes the most probable state sequence and the best sequence probability, that is the likelihood of the path.

For the given HMM the algorithm returns:

  • the best sequence probability :

    not injury injury not injury
    climb 0.1960 0.0627 0.0050
    not climb 0.0180 0.0118 0.0339
  • the most probable state sequence :

    climb, climb, not climb