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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMean
estimateLogProbability
protected 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 MultivariateDistribution
estimateProbability
in class AbstractMultivariateGaussian
sample
- the pointpublic double estimateProbability(Float[] sample)
sample
- the pointpublic double estimateLogProbability(double[] sample)
MultivariateDistribution
estimateLogProbability
in interface MultivariateDistribution
estimateLogProbability
in class AbstractMultivariateGaussian
sample
- the pointpublic Jama.Matrix getCovariance()
MultivariateGaussian
getCovariance
in interface MultivariateGaussian
public int numDims()
MultivariateGaussian
numDims
in interface MultivariateGaussian
numDims
in class AbstractMultivariateGaussian
public double[] sample(Random rng)
MultivariateDistribution
sample
in interface MultivariateDistribution
sample
in class AbstractMultivariateGaussian
rng
- the random number generatorpublic double[][] sample(int count, Random rng)
MultivariateDistribution
sample
in interface MultivariateDistribution
sample
in class AbstractMultivariateGaussian
count
- the number of samples to drawrng
- the random number generatorpublic double getCovariance(int row, int column)
MultivariateGaussian
This 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 MultivariateGaussian
row
- the row of the matrix value to getcolumn
- the column of the matrix value to get