|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math3.distribution.AbstractMultivariateRealDistribution
org.apache.commons.math3.distribution.MultivariateNormalDistribution
public class MultivariateNormalDistribution
Implementation of the multivariate normal (Gaussian) distribution.
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution |
|---|
random |
| Constructor Summary | |
|---|---|
MultivariateNormalDistribution(double[] means,
double[][] covariances)
Creates a multivariate normal distribution with the given mean vector and covariance matrix. |
|
MultivariateNormalDistribution(RandomGenerator rng,
double[] means,
double[][] covariances)
Creates a multivariate normal distribution with the given mean vector and covariance matrix. |
|
| Method Summary | |
|---|---|
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. |
double[] |
sample()
Generates a random value vector sampled from this distribution. |
| Methods inherited from class org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution |
|---|
getDimension, reseedRandomGenerator, sample |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultivariateNormalDistribution(double[] means,
double[][] covariances)
throws SingularMatrixException,
DimensionMismatchException,
NonPositiveDefiniteMatrixException
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 MultivariateNormalDistribution(RandomGenerator rng,
double[] means,
double[][] covariances)
throws SingularMatrixException,
DimensionMismatchException,
NonPositiveDefiniteMatrixException
rng - Random Number Generator.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.| Method Detail |
|---|
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 double[] sample()
sample in interface MultivariateRealDistributionsample in class AbstractMultivariateRealDistribution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||