statistics
Class DensityDiagonal

java.lang.Object
  extended by statistics.Density
      extended by statistics.DensityDiagonal
All Implemented Interfaces:
java.io.Serializable

public final class DensityDiagonal
extends Density

See Also:
Serialized Form

Field Summary
 
Fields inherited from class statistics.Density
apr, ascore, cov, fd, id, lh, MIN_PROB, mue, REGULARIZER, score
 
Constructor Summary
DensityDiagonal(DensityDiagonal copy)
           
DensityDiagonal(DensityFull copy)
           
DensityDiagonal(double apr, double[] mue, double[] cov)
          Create a new Density with diagonal covariance
DensityDiagonal(int dim)
          Create a new Density with diagonal covariance.
 
Method Summary
 Density clone()
          Create a deep copy of this instance.
 double[] drawSample()
           
 double evaluate(double[] x)
          Evaluate the density for the given sample vector x.
static DensityDiagonal fromString(java.lang.String ps)
          Read a parameter string
 java.lang.String toString()
          Obtain a string representation of the density.
 void update()
          Update the internal variables.
 
Methods inherited from class statistics.Density
clear, covarianceAsGnuplot, fill, superVector
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DensityDiagonal

public DensityDiagonal(DensityDiagonal copy)

DensityDiagonal

public DensityDiagonal(DensityFull copy)

DensityDiagonal

public DensityDiagonal(double apr,
                       double[] mue,
                       double[] cov)
Create a new Density with diagonal covariance

Parameters:
apr - prior probability
mue - mean vector
cov - covariance vector

DensityDiagonal

public DensityDiagonal(int dim)
Create a new Density with diagonal covariance.

Parameters:
dim - Feature dimension
Method Detail

clone

public Density clone()
Create a deep copy of this instance.

Specified by:
clone in class Density

drawSample

public double[] drawSample()

evaluate

public double evaluate(double[] x)
Evaluate the density for the given sample vector x. score keeps the probability (without the prior).

Specified by:
evaluate in class Density
Parameters:
x - feature vector
Returns:
prior times score

fromString

public static DensityDiagonal fromString(java.lang.String ps)
Read a parameter string

Parameters:
ps - comma seperated list of double values, representing mean and diagonal covariance
Returns:

toString

public java.lang.String toString()
Obtain a string representation of the density.

Overrides:
toString in class java.lang.Object

update

public void update()
Update the internal variables. Required after modification.

Specified by:
update in class Density