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

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.CentroidObservationVector
All Implemented Interfaces:
Centroid<ObservationVector>

public class CentroidObservationVector
extends java.lang.Object
implements Centroid<ObservationVector>

This class represents the centroid of a set of ObservationVector.


Constructor Summary
CentroidObservationVector(ObservationVector o)
          Creates a new centroid that represents the mean value of a set of ObservationVectors.
 
Method Summary
 double distance(ObservationVector e)
          Returns the distance between this centroid and an element.
 void reevaluateAdd(ObservationVector e, java.util.List<? extends ObservationVector> v)
          Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v plus the value of the observation e.
 void reevaluateRemove(ObservationVector e, java.util.List<? extends ObservationVector> v)
          Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v minus the value of the observation e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentroidObservationVector

public CentroidObservationVector(ObservationVector o)
Creates a new centroid that represents the mean value of a set of ObservationVectors.

Parameters:
o - The initial value of the new centroid.
Method Detail

reevaluateAdd

public void reevaluateAdd(ObservationVector e,
                          java.util.List<? extends ObservationVector> v)
Description copied from interface: Centroid
Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v plus the value of the observation e.

Specified by:
reevaluateAdd in interface Centroid<ObservationVector>
Parameters:
e - An observation that must be involved in the computation of the new value of this centroid.
v - The set of observations that gave the current value of this centroid.

reevaluateRemove

public void reevaluateRemove(ObservationVector e,
                             java.util.List<? extends ObservationVector> v)
Description copied from interface: Centroid
Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v minus the value of the observation e.

Specified by:
reevaluateRemove in interface Centroid<ObservationVector>
Parameters:
e - An observation that must not be involved in the computation of the new value of this centroid.
v - The set of observations (which holds o) that gave the current value of this centroid.

distance

public double distance(ObservationVector e)
Returns the distance between this centroid and an element. The distance metric is the euclidian distance.

Specified by:
distance in interface Centroid<ObservationVector>
Parameters:
e - The element, which must be an ObservationVector with a dimension compatible with this centroid.
Returns:
The distance between element and this centroid.


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