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, toStringpublic 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()
MultivariateGaussianpublic double getCovariance(int row, int col)
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.
row - the row of the matrix value to getcol - the column of the matrix value to getpublic double estimateProbability(double[] sample)
MultivariateDistributionestimateProbability in interface MultivariateDistributionestimateProbability in class AbstractMultivariateGaussiansample - the pointpublic double estimateLogProbability(double[] sample)
MultivariateDistributionestimateLogProbability in interface MultivariateDistributionestimateLogProbability in class AbstractMultivariateGaussiansample - the pointpublic double[] estimateLogProbability(double[][] samples)
MultivariateDistributionestimateLogProbability in interface MultivariateDistributionestimateLogProbability in class AbstractMultivariateGaussiansamples - the samplespublic double[][] sample(int nsamples, Random rng)
MultivariateDistributionsample in interface MultivariateDistributionsample in class AbstractMultivariateGaussiannsamples - the number of samples to drawrng - the random number generator