MultivariateRealDistributionpublic class MultivariateNormalDistribution extends AbstractMultivariateRealDistribution
MultivariateRealDistribution.Sampler| Constructor | Description |
|---|---|
MultivariateNormalDistribution(double[] means,
double[][] covariances) |
Creates a multivariate normal distribution with the given mean vector and
covariance matrix.
|
| Modifier and Type | Method | Description |
|---|---|---|
MultivariateRealDistribution.Sampler |
createSampler(org.apache.commons.rng.UniformRandomProvider rng) |
Creates a sampler.
|
double |
density(double[] vals) |
Returns the probability density function (PDF) of this distribution
evaluated at the specified point
x. |
RealMatrix |
getCovariances() |
Gets the covariance matrix.
|
double[] |
getMeans() |
Gets the mean vector.
|
double[] |
getStandardDeviations() |
Gets the square root of each element on the diagonal of the covariance
matrix.
|
getDimension, samplepublic MultivariateNormalDistribution(double[] means,
double[][] covariances)
throws SingularMatrixException,
DimensionMismatchException,
NonPositiveDefiniteMatrixException
The number of dimensions is equal to the length of the mean vector and to the number of rows and columns of the covariance matrix. It is frequently written as "p" in formulae.
means - Vector of means.covariances - Covariance matrix.DimensionMismatchException - if the arrays length are
inconsistent.SingularMatrixException - if the eigenvalue decomposition cannot
be performed on the provided covariance matrix.NonPositiveDefiniteMatrixException - if any of the eigenvalues is
negative.public double[] getMeans()
public RealMatrix getCovariances()
public double density(double[] vals)
throws DimensionMismatchException
x. In general, the PDF is the
derivative of the cumulative distribution function. If the derivative
does not exist at x, then an appropriate replacement should be
returned, e.g. Double.POSITIVE_INFINITY, Double.NaN, or
the limit inferior or limit superior of the difference quotient.vals - Point at which the PDF is evaluated.x.DimensionMismatchExceptionpublic double[] getStandardDeviations()
public MultivariateRealDistribution.Sampler createSampler(org.apache.commons.rng.UniformRandomProvider rng)
createSampler in interface MultivariateRealDistributioncreateSampler in class AbstractMultivariateRealDistributionrng - Generator of uniformly distributed numbers.Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.