Sautrela

edu.gtts.sautrela.wfsa.models
Class Gaussian

java.lang.Object
  extended by edu.gtts.sautrela.wfsa.models.Gaussian

public class Gaussian
extends java.lang.Object

Gaussian Probability Density Function

Author:
mpenagar

Constructor Summary
Gaussian(java.lang.String name, double[] mean, double[] var, double[] varFloor, boolean trainMean, boolean trainVar)
          Creates a new instance of Gaussian
 
Method Summary
 void addTrain(double[] x)
          Equivalent to addTrain(x,1.0)
 void addTrain(double[] x, double count)
           
 Gaussian clone()
          Returns a copy of this Gaussian.
 void dump()
           
 void dump(Gaussian[] clones)
           
 boolean equals(Gaussian other)
          Indicates whether some other Gaussian is "equal to" this one.
 double getLogNorma()
           
 double[] getMean()
           
 java.lang.String getName()
           
 double getProb(double[] x)
          Returns the log probability of an array.
 double[] getRandomData()
          Returns a random vector.
 double[] getVar()
           
 double[] getVarFloor()
           
 void initTrain()
           
 void initTrain(double initCount)
           
 boolean isTrainMean()
           
 boolean isTrainVar()
           
 Gaussian randomClone()
          Returns a new Gaussian with random mean, but same var, varFloor & trainFlags.
 void resize(int newdim)
           
 void setName(java.lang.String name)
           
 void setTrainMean(boolean flag)
           
 void setTrainVar(boolean flag)
           
 Gaussian split()
          Returns a new Gaussian with random mean, but same var, varFloor & trainFlags.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gaussian

public Gaussian(java.lang.String name,
                double[] mean,
                double[] var,
                double[] varFloor,
                boolean trainMean,
                boolean trainVar)
Creates a new instance of Gaussian

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getMean

public double[] getMean()

getVar

public double[] getVar()

getVarFloor

public double[] getVarFloor()

getLogNorma

public double getLogNorma()

isTrainMean

public boolean isTrainMean()

setTrainMean

public void setTrainMean(boolean flag)

isTrainVar

public boolean isTrainVar()

setTrainVar

public void setTrainVar(boolean flag)

resize

public void resize(int newdim)

getProb

public double getProb(double[] x)
Returns the log probability of an array.

Parameters:
x - the data
Returns:
the log probability

getRandomData

public double[] getRandomData()
Returns a random vector.

Returns:
the log probability

clone

public Gaussian clone()
Returns a copy of this Gaussian.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this Gaussian

randomClone

public Gaussian randomClone()
Returns a new Gaussian with random mean, but same var, varFloor & trainFlags.

Returns:
a new Gaussian with random mean, but same var, varFloor & trainFlags

split

public Gaussian split()
Returns a new Gaussian with random mean, but same var, varFloor & trainFlags. Random means are obtained using the varFloor instead of the variance

Returns:
a new Gaussian with random mean, but same var, varFloor & trainFlags

initTrain

public void initTrain()

initTrain

public void initTrain(double initCount)

addTrain

public void addTrain(double[] x)
Equivalent to addTrain(x,1.0)


addTrain

public void addTrain(double[] x,
                     double count)

dump

public void dump()

dump

public void dump(Gaussian[] clones)

equals

public boolean equals(Gaussian other)
Indicates whether some other Gaussian is "equal to" this one. Compares the mean and variances of both Gaussian (weigths are not considered).

Parameters:
other - - the reference Gaussian with which to compare
Returns:
true if this object is the same as the other argument; false otherwise.

Sautrela