SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MultiNormalDist Class Reference

Implements the abstract class ContinuousDistributionMulti for the multinormal distribution with mean vector \(\boldsymbol{\mu}\) and covariance matrix \(\boldsymbol{\Sigma}\). More...

Inheritance diagram for MultiNormalDist:
[legend]
Collaboration diagram for MultiNormalDist:
[legend]

Public Member Functions

 MultiNormalDist (double[] mu, double[][] sigma)
 
double density (double[] x)
 
double [] getMean ()
 
double [][] getCovariance ()
 
double [][] getCorrelation ()
 
int getDimension ()
 Returns the dimension \(d\) of the distribution.
 
double [] getMu ()
 Returns the parameter \(\boldsymbol{\mu}\) of this object.
 
double getMu (int i)
 Returns the \(i\)-th component of the parameter \(\boldsymbol{\mu}\) of this object.
 
double [][] getSigma ()
 Returns the parameter \(\boldsymbol{\Sigma}\) of this object.
 
void setParams (double[] mu, double[][] sigma)
 Sets the parameters \(\boldsymbol{\mu}\) and \(\boldsymbol{\Sigma}\) of this object.
 
- Public Member Functions inherited from ContinuousDistributionMulti
abstract double density (double[] x)
 Returns \(f(x_1, x_2, …, x_d)\), the probability density of \(X\) evaluated at the point \(x\), where \(x = \{x_1, x_2, …, x_d\}\). More...
 
int getDimension ()
 Returns the dimension \(d\) of the distribution.
 
abstract double [] getMean ()
 Returns the mean vector of the distribution, defined as \(\mu_i = E[X_i]\).
 
abstract double [][] getCovariance ()
 Returns the variance-covariance matrix of the distribution, defined as
\(\sigma_{ij} = E[(X_i - \mu_i)(X_j - \mu_j)]\).
 
abstract double [][] getCorrelation ()
 Returns the correlation matrix of the distribution, defined as \(\rho_{ij} = \sigma_{ij}/\sqrt{\sigma_{ii}\sigma_{jj}}\).
 

Static Public Member Functions

static double density (double[] mu, double[][] sigma, double[] x)
 Computes the density ( fMultinormal ) of the multinormal distribution with parameters \(\boldsymbol{\mu}=\) mu and \(\boldsymbol{\Sigma}=\) sigma, evaluated at x.
 
static double [] getMean (double[] mu, double[][] sigma)
 Returns the mean \(E[\mathbf{X}] = \boldsymbol{\mu}\) of the multinormal distribution with parameters \(\boldsymbol{\mu}\) and \(\boldsymbol{\Sigma}\).
 
static double [][] getCovariance (double[] mu, double[][] sigma)
 Computes the covariance matrix of the multinormal distribution with parameters \(\boldsymbol{\mu}\) and \(\boldsymbol{\Sigma}\).
 
static double [][] getCorrelation (double[] mu, double[][] sigma)
 Computes the correlation matrix of the multinormal distribution with parameters \(\boldsymbol{\mu}\) and \(\boldsymbol{\Sigma}\)).
 
static double [] getMLEMu (double[][] x, int n, int d)
 Estimates the parameters \(\boldsymbol{\mu}\) of the multinormal distribution using the maximum likelihood method. More...
 
static double [][] getMLESigma (double[][] x, int n, int d)
 Estimates the parameters \(\boldsymbol{\Sigma}\) of the multinormal distribution using the maximum likelihood method. More...
 

Protected Attributes

int dim
 
double [] mu
 
DoubleMatrix2D sigma
 
DoubleMatrix2D invSigma
 
- Protected Attributes inherited from ContinuousDistributionMulti
int dimension
 

Static Protected Attributes

static Algebra algebra = new Algebra()
 

Detailed Description

Implements the abstract class ContinuousDistributionMulti for the multinormal distribution with mean vector \(\boldsymbol{\mu}\) and covariance matrix \(\boldsymbol{\Sigma}\).

The probability density is

\[ f(\mathbf{x}) = \frac{1}{\sqrt{(2\pi)^d \det\boldsymbol{\Sigma}}} \exp\left(-\frac{1}{2}(\mathbf{x}- \boldsymbol{\mu})^T \boldsymbol{\Sigma}^{-1} (\mathbf{x}- \boldsymbol{\mu})\right) \tag{fMultinormal} \]

where \(\mathbf{x}= (x_1,…,x_d)\).

Member Function Documentation

◆ getMLEMu()

static double [] getMLEMu ( double  x[][],
int  n,
int  d 
)
static

Estimates the parameters \(\boldsymbol{\mu}\) of the multinormal distribution using the maximum likelihood method.

It uses the \(n\) observations of \(d\) components in table \(x[i][j]\), \(i = 0, 1, …, n-1\) and \(j = 0, 1, …, d-1\).

Parameters
xthe list of observations used to evaluate parameters
nthe number of observations used to evaluate parameters
dthe dimension of each observation
Returns
returns the parameters [ \(\boldsymbol{\mu}_1\),…, \(\boldsymbol{\mu}_d\)]

◆ getMLESigma()

static double [][] getMLESigma ( double  x[][],
int  n,
int  d 
)
static

Estimates the parameters \(\boldsymbol{\Sigma}\) of the multinormal distribution using the maximum likelihood method.

It uses the \(n\) observations of \(d\) components in table \(x[i][j]\), \(i = 0, 1, …, n-1\) and \(j = 0, 1, …, d-1\).

Parameters
xthe list of observations used to evaluate parameters
nthe number of observations used to evaluate parameters
dthe dimension of each observation
Returns
returns the covariance matrix \(\boldsymbol{\Sigma}\)

The documentation for this class was generated from the following file: