public class CachingMultivariateGaussian extends AbstractMultivariateGaussian implements MultivariateGaussian
| Modifier and Type | Field and Description |
|---|---|
protected Jama.Matrix |
covar |
protected int |
N |
mean| Modifier | Constructor and Description |
|---|---|
protected |
CachingMultivariateGaussian() |
|
CachingMultivariateGaussian(int ndims)
Construct the Gaussian with the zero mean and unit variance
|
|
CachingMultivariateGaussian(Jama.Matrix mean,
Jama.Matrix covar)
Construct the Gaussian with the provided center and covariance
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cacheValues() |
static MultivariateGaussian |
estimate(double[][] samples)
Estimate a multidimensional Gaussian from the data
|
static CachingMultivariateGaussian |
estimate(float[][] samples)
Estimate a multidimensional Gaussian from the data
|
static MultivariateGaussian |
estimate(Jama.Matrix samples)
Estimate a multidimensional Gaussian from the data
|
double |
estimateLogProbability(double[] sample)
Get the log probability for a given point in space relative to the PDF
represented by this distribution.
|
double |
estimateProbability(double[] sample)
Get the probability for a given point in space relative to the PDF
represented by this Gaussian.
|
double |
estimateProbability(Float[] sample)
Get the probability for a given point in space relative to the PDF
represented by this Gaussian.
|
Jama.Matrix |
getCovariance()
Get the covariance
|
double |
getCovariance(int row,
int column)
Get a covariance value from the covariance matrix.
|
int |
numDims()
Get the dimensionality
|
double[][] |
sample(int count,
Random rng)
Sample the distribution.
|
double[] |
sample(Random rng)
Sample the distribution.
|
estimateLogProbability, getMean, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMeanestimateLogProbabilityprotected CachingMultivariateGaussian()
public CachingMultivariateGaussian(Jama.Matrix mean, Jama.Matrix covar)
mean - centre of the Gaussiancovar - covariance of the Gaussianpublic CachingMultivariateGaussian(int ndims)
ndims - number of dimensionsprotected void cacheValues()
public static CachingMultivariateGaussian estimate(float[][] samples)
samples - the datapublic static MultivariateGaussian estimate(Jama.Matrix samples)
samples - the datapublic static MultivariateGaussian estimate(double[][] samples)
samples - the datapublic double estimateProbability(double[] sample)
estimateProbability in interface MultivariateDistributionestimateProbability in class AbstractMultivariateGaussiansample - the pointpublic double estimateProbability(Float[] sample)
sample - the pointpublic double estimateLogProbability(double[] sample)
MultivariateDistributionestimateLogProbability in interface MultivariateDistributionestimateLogProbability in class AbstractMultivariateGaussiansample - the pointpublic Jama.Matrix getCovariance()
MultivariateGaussiangetCovariance in interface MultivariateGaussianpublic int numDims()
MultivariateGaussiannumDims in interface MultivariateGaussiannumDims in class AbstractMultivariateGaussianpublic double[] sample(Random rng)
MultivariateDistributionsample in interface MultivariateDistributionsample in class AbstractMultivariateGaussianrng - the random number generatorpublic double[][] sample(int count, Random rng)
MultivariateDistributionsample in interface MultivariateDistributionsample in class AbstractMultivariateGaussiancount - the number of samples to drawrng - the random number generatorpublic double getCovariance(int row, int column)
MultivariateGaussianThis method is provided for efficiency as not all implementations will store the full matrix, and it would be wasteful to create it each time a value is needed.
getCovariance in interface MultivariateGaussianrow - the row of the matrix value to getcolumn - the column of the matrix value to get