be.ac.ulg.montefiore.run.jahmm.toolbox
Class KullbackLeiblerDistanceCalculator

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.toolbox.KullbackLeiblerDistanceCalculator

public class KullbackLeiblerDistanceCalculator
extends java.lang.Object

Computes the distance between HMMs.

The distance metric is similar to the Kullback-Leibler distance defined on distributions. More information can be found in A Probabilistic Distance Measure For HMMs by Rabiner and Juang (AT&T Technical Journal, vol. 64, Feb. 1985, pages 391-408).

This distance measure is not symetric: distance(hmm1, hmm2) is not necessary equal to distance(hmm2, hmm1). To get a symetric distance definition, compute (distance(hmm1, hmm2) + distance(hmm2, hmm1)) / 2.


Constructor Summary
KullbackLeiblerDistanceCalculator()
           
 
Method Summary
<O extends Observation>
double
distance(Hmm<O> hmm1, Hmm<? super O> hmm2)
          Computes the Kullback-Leibler distance between two HMMs.
 int getNbSequences()
          Returns the number of sequences generated to estimate a distance.
 int getSequencesLength()
          Returns the length of sequences generated to estimate a distance.
 void setNbSequences(int nb)
          Sets the number of sequences generated to estimate a distance.
 void setSequencesLength(int length)
          Sets the length of sequences generated to estimate a distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KullbackLeiblerDistanceCalculator

public KullbackLeiblerDistanceCalculator()
Method Detail

distance

public <O extends Observation> double distance(Hmm<O> hmm1,
                                               Hmm<? super O> hmm2)
Computes the Kullback-Leibler distance between two HMMs.

Parameters:
hmm1 - The first HMM against which the distance is computed. The distance is mesured with regard to this HMM (this must be defined since the Kullback-Leibler distance is not symetric).
hmm2 - The second HMM against which the distance is computed.
Returns:
The distance between hmm1 and hmm2 with regard to hmm1

getNbSequences

public int getNbSequences()
Returns the number of sequences generated to estimate a distance.

Returns:
The number of generated sequences.

setNbSequences

public void setNbSequences(int nb)
Sets the number of sequences generated to estimate a distance.

Parameters:
nb - The number of generated sequences.

getSequencesLength

public int getSequencesLength()
Returns the length of sequences generated to estimate a distance.

Returns:
The sequences length.

setSequencesLength

public void setSequencesLength(int length)
Sets the length of sequences generated to estimate a distance.

Parameters:
length - The sequences length.


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