be.ac.ulg.montefiore.run.jahmm
Class ForwardBackwardScaledCalculator

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.ForwardBackwardCalculator
      extended by be.ac.ulg.montefiore.run.jahmm.ForwardBackwardScaledCalculator

public class ForwardBackwardScaledCalculator
extends ForwardBackwardCalculator

This class can be used to compute the probability of a given observations sequence for a given HMM.

This class implements the scaling method explained in Rabiner and Juang, thus the alphaElement and betaElement return the scaled alpha and beta elements. The alpha array must always be computed because the scaling factors are computed together with it.

For more information on the scaling procedure, read Rabiner and Juang's Fundamentals of speech recognition (Prentice Hall, 1993).


Nested Class Summary
 
Nested classes/interfaces inherited from class be.ac.ulg.montefiore.run.jahmm.ForwardBackwardCalculator
ForwardBackwardCalculator.Computation
 
Field Summary
 
Fields inherited from class be.ac.ulg.montefiore.run.jahmm.ForwardBackwardCalculator
alpha, beta, probability
 
Constructor Summary
ForwardBackwardScaledCalculator(java.util.List<? extends O> oseq, Hmm<O> hmm)
          Computes the probability of occurence of an observation sequence given a Hidden Markov Model.
ForwardBackwardScaledCalculator(java.util.List<? extends O> oseq, Hmm<O> hmm, java.util.EnumSet<ForwardBackwardCalculator.Computation> flags)
          Computes the probability of occurence of an observation sequence given a Hidden Markov Model.
 
Method Summary
protected
<O extends Observation>
void
computeAlpha(Hmm<? super O> hmm, java.util.List<O> oseq)
           
protected
<O extends Observation>
void
computeBeta(Hmm<? super O> hmm, java.util.List<O> oseq)
           
 double lnProbability()
          Return the neperian logarithm of the probability of the sequence that generated this object.
 
Methods inherited from class be.ac.ulg.montefiore.run.jahmm.ForwardBackwardCalculator
alphaElement, betaElement, computeAlphaInit, computeAlphaStep, computeBetaStep, probability
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardBackwardScaledCalculator

public ForwardBackwardScaledCalculator(java.util.List<? extends O> oseq,
                                       Hmm<O> hmm,
                                       java.util.EnumSet<ForwardBackwardCalculator.Computation> flags)
Computes the probability of occurence of an observation sequence given a Hidden Markov Model. The algorithms implemented use scaling to avoid underflows.

Parameters:
hmm - A Hidden Markov Model;
oseq - An observations sequence.
flags - How the computation should be done. See the ForwardBackwardCalculator.Computation. The alpha array is always computed.

ForwardBackwardScaledCalculator

public ForwardBackwardScaledCalculator(java.util.List<? extends O> oseq,
                                       Hmm<O> hmm)
Computes the probability of occurence of an observation sequence given a Hidden Markov Model. This computation computes the scaled alpha array as a side effect.

See Also:
ForwardBackwardScaledCalculator(List, Hmm, EnumSet)
Method Detail

computeAlpha

protected <O extends Observation> void computeAlpha(Hmm<? super O> hmm,
                                                    java.util.List<O> oseq)
Overrides:
computeAlpha in class ForwardBackwardCalculator

computeBeta

protected <O extends Observation> void computeBeta(Hmm<? super O> hmm,
                                                   java.util.List<O> oseq)
Overrides:
computeBeta in class ForwardBackwardCalculator

lnProbability

public double lnProbability()
Return the neperian logarithm of the probability of the sequence that generated this object.

Returns:
The probability of the sequence of interest's neperian logarithm.


Copyright © 2004,2005 Jean-Marc François.