public class DiagonalMultivariateGaussian extends AbstractMultivariateGaussian
MultivariateGaussian
with a diagonal covariance
matrix.Modifier and Type | Field and Description |
---|---|
double[] |
variance
The diagonal of the covariance matrix
|
mean
Constructor and Description |
---|
DiagonalMultivariateGaussian(int ndims)
Construct the Gaussian with the zero mean and unit variance
|
DiagonalMultivariateGaussian(Jama.Matrix mean,
double[] variance)
Construct the Gaussian with the provided center and covariance
|
Modifier and Type | Method and Description |
---|---|
double |
estimateLogProbability(double[] sample)
Get the log probability for a given point in space relative to the PDF
represented by this distribution.
|
double[] |
estimateLogProbability(double[][] samples)
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 distribution.
|
Jama.Matrix |
getCovariance()
Get the covariance
|
double |
getCovariance(int row,
int col)
Get a covariance value from the covariance matrix.
|
double[][] |
sample(int nsamples,
Random rng)
Sample the distribution.
|
getMean, numDims, sample, toString
public double[] variance
public DiagonalMultivariateGaussian(Jama.Matrix mean, double[] variance)
mean
- centre of the Gaussianvariance
- variance of the Gaussianpublic DiagonalMultivariateGaussian(int ndims)
ndims
- number of dimensionspublic Jama.Matrix getCovariance()
MultivariateGaussian
public double getCovariance(int row, int col)
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.
row
- the row of the matrix value to getcol
- the column of the matrix value to getpublic double estimateProbability(double[] sample)
MultivariateDistribution
estimateProbability
in interface MultivariateDistribution
estimateProbability
in class AbstractMultivariateGaussian
sample
- the pointpublic double estimateLogProbability(double[] sample)
MultivariateDistribution
estimateLogProbability
in interface MultivariateDistribution
estimateLogProbability
in class AbstractMultivariateGaussian
sample
- the pointpublic double[] estimateLogProbability(double[][] samples)
MultivariateDistribution
estimateLogProbability
in interface MultivariateDistribution
estimateLogProbability
in class AbstractMultivariateGaussian
samples
- the samplespublic double[][] sample(int nsamples, Random rng)
MultivariateDistribution
sample
in interface MultivariateDistribution
sample
in class AbstractMultivariateGaussian
nsamples
- the number of samples to drawrng
- the random number generator