public final class HmmAlgorithms extends Object
Modifier and Type | Method and Description |
---|---|
static Matrix |
backwardAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
External function to compute a matrix of beta factors
|
static Matrix |
forwardAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
External function to compute a matrix of alpha factors
|
static int[] |
viterbiAlgorithm(HmmModel model,
int[] observations,
boolean scaled)
Viterbi algorithm to compute the most likely hidden sequence for a given
model and observed sequence
|
public static Matrix forwardAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- model to run forward algorithm for.observations
- observation sequence to train on.scaled
- Should log-scaled beta factors be computed?public static Matrix backwardAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- model to use for estimation.observations
- observation sequence seen.scaled
- Set to true if log-scaled beta factors should be computed.public static int[] viterbiAlgorithm(HmmModel model, int[] observations, boolean scaled)
model
- HmmModel for which the Viterbi path should be computedobservations
- Sequence of observationsscaled
- Use log-scaled computations, this requires higher computational
effort but is numerically more stable for large observation
sequencesCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.