weka.estimators

## Class MultivariateGaussianEstimator

- java.lang.Object
- - weka.estimators.MultivariateGaussianEstimator

- All Implemented Interfaces:
    java.lang.Cloneable, MultivariateEstimator

      public class MultivariateGaussianEstimator
      extends java.lang.Object
      implements MultivariateEstimator, java.lang.Cloneable

  Implementation of Multivariate Distribution Estimation using Normal Distribution. *
  Version:
    $Revision: 10459 $
  Author:
    Uday Kamath, PhD, George Mason University

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `Log2PI` Log of twice number pi: log(2*pi).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultivariateGaussianEstimator()`
    `MultivariateGaussianEstimator(double[] means, double[][] covariance)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultivariateGaussianEstimator` | `clone()`
    `static double[][]` | `covariance(double[][] matrix, double[] means)` Calculates the covariance matrix of a sample matrix.
    `void` | `estimate(double[][] observations, double[] weights)` Fits the value to the density estimator.
    `double[][]` | `getCovariance()`
    `double[]` | `getMean()`
    `double` | `getProbability(double[] value)` Returns the probability density estimate at the given point.
    `double` | `logDensity(double[] valuePassed)` Returns the log likelihood of density value for the Multivariate distribution
    `static void` | `main(java.lang.String[] args)`
    `static double[][]` | `scatter(double[][] matrix, double[] means, double divisor, int dimension)` Calculates the scatter matrix of a sample matrix.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### Log2PI

          public static final double Log2PI

      Log of twice number pi: log(2*pi).
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MultivariateGaussianEstimator

          public MultivariateGaussianEstimator()

    - #### MultivariateGaussianEstimator

          public MultivariateGaussianEstimator(double[] means,
                                       double[][] covariance)

  - ### Method Detail

    - #### clone

          public MultivariateGaussianEstimator clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### getProbability

          public double getProbability(double[] value)

      Returns the probability density estimate at the given point.
      Specified by:
        `getProbability` in interface `MultivariateEstimator`
      Parameters:
        `value` - the value at which to evaluate
      Returns:
        the the density estimate at the given value

    - #### logDensity

          public double logDensity(double[] valuePassed)

      Returns the log likelihood of density value for the Multivariate distribution
      Specified by:
        `logDensity` in interface `MultivariateEstimator`
      Parameters:
        `input` - vector
      Returns:
        log density based on given distribution

    - #### estimate

          public void estimate(double[][] observations,
                      double[] weights)

      Description copied from interface: `MultivariateEstimator`
      Fits the value to the density estimator.
      Specified by:
        `estimate` in interface `MultivariateEstimator`
      Parameters:
        `observations` - the value to add
        `weights` - the weight of the value
      See Also:
        `MultivariateEstimator.estimate(double[][], double[])`

    - #### getMean

          public double[] getMean()

    - #### getCovariance

          public double[][] getCovariance()

    - #### covariance

          public static double[][] covariance(double[][] matrix,
                              double[] means)

      Calculates the covariance matrix of a sample matrix. In statistics and probability theory, the covariance matrix is a matrix of covariances between elements of a vector. It is the natural generalization to higher dimensions of the concept of the variance of a scalar-valued random variable.
      Parameters:
        `matrix` - A number multi-dimensional array containing the matrix values.
        `means` - The values' mean vector, if already known.
      Returns:
        The covariance matrix.

    - #### scatter

          public static double[][] scatter(double[][] matrix,
                           double[] means,
                           double divisor,
                           int dimension)

      Calculates the scatter matrix of a sample matrix. By dividing the Scatter matrix by the sample size, we get the population Covariance matrix. By dividing by the sample size minus one, we get the sample Covariance matrix.
      Parameters:
        `matrix` - A number multi-dimensional array containing the matrix values.
        `means` - The values' mean vector, if already known.
        `divisor` - A real number to divide each member of the matrix.
        `dimension` - Pass 0 to if mean vector is a row vector, 1 otherwise. Default value is 0.
      Returns:
        The covariance matrix.

    - #### main

          public static void main(java.lang.String[] args)