public class MultivariateGaussianEstimator extends java.lang.Object implements MultivariateEstimator, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static double |
Log2PI
Log of twice number pi: log(2*pi).
|
Constructor and Description |
---|
MultivariateGaussianEstimator() |
MultivariateGaussianEstimator(double[] means,
double[][] covariance) |
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.
|
public static final double Log2PI
public MultivariateGaussianEstimator()
public MultivariateGaussianEstimator(double[] means, double[][] covariance)
public MultivariateGaussianEstimator clone()
clone
in class java.lang.Object
public double getProbability(double[] value)
getProbability
in interface MultivariateEstimator
value
- the value at which to evaluatepublic double logDensity(double[] valuePassed)
logDensity
in interface MultivariateEstimator
input
- vectorpublic void estimate(double[][] observations, double[] weights)
MultivariateEstimator
estimate
in interface MultivariateEstimator
observations
- the value to addweights
- the weight of the valueMultivariateEstimator.estimate(double[][], double[])
public double[] getMean()
public double[][] getCovariance()
public static double[][] covariance(double[][] matrix, double[] means)
matrix
- A number multi-dimensional array containing the matrix
values.means
- The values' mean vector, if already known.public static double[][] scatter(double[][] matrix, double[] means, double divisor, int dimension)
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.public static void main(java.lang.String[] args)