[][src]Function bio::stats::hmm::viterbi

pub fn viterbi<O, M: Model<O>>(
    hmm: &M,
    observations: &[O]
) -> (Vec<State>, LogProb)

Execute Viterbi algorithm on the given slice of Observation values to get the maximum a posteriori (MAP) probability.

Arguments

  • hmm - the Model to run the Viterbi algorithm on
  • observations - a slice of observation values to use in the algorithm

Result

The resulting pair (s, p) is the Vec<State> of most probable states given hmm and observations as well as the probability (as LogProb) of path s.

Type Parameters

  • O - the observation type
  • M - type Model type