statistics
Class DensityFull

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

public final class DensityFull
extends Density

The DensityFull is a Gaussian density with full covariance matrix. The computation is sped up using Cholesky decomposition. This is also numerically stable. K = L L^T => K^-1 = L^T^-1 L^-1 z = x - mue z^T K^-1 z = || L^-1 x ||^2 = || y ||^2 y = L^-1 x => x = L y; solve using forward substitution

Author:
sikoried
See Also:
Serialized Form

Field Summary
static double GAMMA
          regularization constant
 double[] L
          cov = L L^T where L is a lower triangular, packed matrix; Cholesky decomposition!
 
Fields inherited from class statistics.Density
apr, ascore, cov, fd, id, lh, MIN_PROB, mue, REGULARIZER, score
 
Constructor Summary
DensityFull(DensityFull copy)
           
DensityFull(double apr, double[] mue, double[] cov)
          Create a new Density with diagonal covariance
DensityFull(int dim)
           
 
Method Summary
 Density clone()
          Create a deep copy of this instance.
 double evaluate(double[] x)
          Evaluate the density for the given sample vector x.
 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
 

Field Detail

GAMMA

public static final transient double GAMMA
regularization constant

See Also:
Constant Field Values

L

public double[] L
cov = L L^T where L is a lower triangular, packed matrix; Cholesky decomposition!

Constructor Detail

DensityFull

public DensityFull(DensityFull copy)

DensityFull

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

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

DensityFull

public DensityFull(int dim)
Method Detail

clone

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

Specified by:
clone in class Density

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

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