de.unihalle.informatik.MiToBo.math.distributions.impl

## Class GaussianDistribution

• java.lang.Object
• de.unihalle.informatik.MiToBo.math.distributions.impl.GaussianDistribution
• ### Field Summary

Fields
Modifier and Type Field and Description
`protected Jama.Matrix` `cov`
covariance matrix
`protected Jama.Matrix` `icov`
inverse covariance matrix
`protected Jama.Matrix` `L`
`protected double` `logfactor`
log of the normalization factor
`protected Jama.Matrix` `mean`
mean vector
`protected double` `normfactor`
normalization factor
`protected Random` `rand`
random generator for sampling
• ### Constructor Summary

Constructors
Modifier Constructor and Description
`protected ` `GaussianDistribution(int DOF)`
Constructor for a Gaussian distribution of dimension DOF with the zero vector as mean, the unity matrix as covariance matrix and a new random generator for sampling
` ` ```GaussianDistribution(int DOF, Random rand)```
Constructor for a Gaussian distribution of dimension DOF with the zero vector as mean, the unity matrix as covariance matrix and a given random generator for sampling
` ` ```GaussianDistribution(Jama.Matrix mean, Jama.Matrix covariance)```
Gaussian distribution with given mean, covariance and a new random generator for sampling
` ` ```GaussianDistribution(Jama.Matrix mean, Jama.Matrix covariance, Random rand)```
Gaussian distribution with given mean, covariance and random generator for sampling
• ### Method Summary

All Methods
Modifier and Type Method and Description
`GaussianDistribution` `copy()`
`Jama.Matrix` `drawSample()`
Generate a new sample from this density.
`Jama.Matrix` `getCovariance()`
Returns the covariance matrix
`Jama.Matrix` `getInverseCovariance()`
`Jama.Matrix` `getMean()`
Returns the mean vector.
`double` `log_p(Jama.Matrix x)`
Evaluate natural logarithm of p(X) at location x. log(P(X=x))
`double` `mahalanobis(Jama.Matrix x)`
`double` `p(Jama.Matrix x)`
Evaluate p(X) at location x.
`void` `setCovariance(Jama.Matrix covariance)`
`void` `setMean(Jama.Matrix mean)`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### mean

`protected Jama.Matrix mean`
mean vector
• #### cov

`protected Jama.Matrix cov`
covariance matrix
• #### icov

`protected Jama.Matrix icov`
inverse covariance matrix
• #### rand

`protected Random rand`
random generator for sampling
• #### normfactor

`protected double normfactor`
normalization factor
• #### logfactor

`protected double logfactor`
log of the normalization factor
• #### L

`protected Jama.Matrix L`
• ### Constructor Detail

• #### GaussianDistribution

`protected GaussianDistribution(int DOF)`
Constructor for a Gaussian distribution of dimension DOF with the zero vector as mean, the unity matrix as covariance matrix and a new random generator for sampling
Parameters:
`DOF` -
• #### GaussianDistribution

```public GaussianDistribution(int DOF,
Random rand)```
Constructor for a Gaussian distribution of dimension DOF with the zero vector as mean, the unity matrix as covariance matrix and a given random generator for sampling
Parameters:
`DOF` -
`rand` -
• #### GaussianDistribution

```public GaussianDistribution(Jama.Matrix mean,
Jama.Matrix covariance)
throws IllegalArgumentException```
Gaussian distribution with given mean, covariance and a new random generator for sampling
Parameters:
`mean` -
`covariance` -
Throws:
`IllegalArgumentException`
• #### GaussianDistribution

```public GaussianDistribution(Jama.Matrix mean,
Jama.Matrix covariance,
Random rand)
throws IllegalArgumentException```
Gaussian distribution with given mean, covariance and random generator for sampling
Parameters:
`mean` -
`covariance` -
`rand` -
Throws:
`IllegalArgumentException`
• ### Method Detail

• #### getMean

`public Jama.Matrix getMean()`
Returns the mean vector.
Specified by:
`getMean` in interface `FirstOrderMoment<Jama.Matrix>`
• #### setMean

```public void setMean(Jama.Matrix mean)
throws IllegalArgumentException```
Throws:
`IllegalArgumentException`
• #### getCovariance

`public Jama.Matrix getCovariance()`
Returns the covariance matrix
Specified by:
`getCovariance` in interface `SecondOrderCentralMoment<Jama.Matrix>`
Returns:
• #### getInverseCovariance

`public Jama.Matrix getInverseCovariance()`
• #### setCovariance

```public void setCovariance(Jama.Matrix covariance)
throws IllegalArgumentException```
Throws:
`IllegalArgumentException`
• #### log_p

`public double log_p(Jama.Matrix x)`
Description copied from interface: `LogEvaluatableDistribution`
Evaluate natural logarithm of p(X) at location x. log(P(X=x))
Specified by:
`log_p` in interface `LogEvaluatableDistribution<Jama.Matrix>`
Parameters:
`x` - realization of random variable X
Returns:
value of log(p(X)) at x
• #### p

`public double p(Jama.Matrix x)`
Description copied from interface: `EvaluatableDistribution`
Evaluate p(X) at location x. P(X=x)
Specified by:
`p` in interface `EvaluatableDistribution<Jama.Matrix>`
Parameters:
`x` - realization of random variable X
Returns:
value of p(X) at x
• #### drawSample

`public Jama.Matrix drawSample()`
Description copied from interface: `SamplingDistribution`
Generate a new sample from this density. This method should create a new object.
Specified by:
`drawSample` in interface `SamplingDistribution<Jama.Matrix>`
Returns:
new sample object
• #### mahalanobis

`public double mahalanobis(Jama.Matrix x)`
• #### copy

`public GaussianDistribution copy()`
Specified by:
`copy` in interface `Copyable<GaussianDistribution>`