ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_distUnifElls Module Reference

This module contains classes and procedures for computing various statistical quantities related to the Multiple MultiVariate Uniform Ellipsoid (MMVUE) distribution. More...

Data Types

type  distUnifElls_type
 This is the derived type for signifying distributions that are of type Multiple MultiVariate Uniform Ellipsoid (MMVUE) as defined in the description of pm_distUnifElls. More...
 
interface  getUnifEllsLogPDF
 Generate and return the natural logarithm of an approximation of the Probability Density Function (PDF) of the Multiple MultiVariate Uniformly Ellipsoidal (MMVUE) Distribution.
More...
 
interface  setUnifEllsRand
 Return a collection of random vectors of size ndim from the ndim-dimensional Multiple MultiVariate Uniform Ellipsoidal (MMVUE) distribution, with the specified input mean(1:ndim, 1:nell) and optionally the specified subset of the Cholesky Factorization of the Gramian matrices of the MMVUE distribution.
More...
 

Variables

character(*, SK), parameter MODULE_NAME = "@pm_distUnifElls"
 

Detailed Description

This module contains classes and procedures for computing various statistical quantities related to the Multiple MultiVariate Uniform Ellipsoid (MMVUE) distribution.

Specifically, this module contains routines for computing the following quantities of the Multiple MultiVariate Uniform Ellipsoid (MMVUE) distribution:

  1. the Probability Density Function (PDF)
  2. the Random Number Generation from the distribution (RNG)

An \(\ndim\)-dimensional MMVUE distribution is represented by a set of \(\ndim\)-dimensional hyper-ellipsoid supports.
The MMVUE distribution is fully determined by a set of ellipsoids \(\ell_i, i = 1 : N_\ell\) containing its support.
An ellipsoid \(\ell\) is in turn fully determined by its representative Gramian matrix \(\gramian_\ell\), containing all points in \(\mathbb{R}^\ndim\) that satisfy,

\begin{equation} \large (X - \mu_\ell)^T ~ \gramian_\ell^{-1} ~ (X - \mu_\ell) \leq 1 ~, \end{equation}

where \(\mu_\ell\) represents the center of the ellipsoid, \((X - \mu_\ell)^T\) is the transpose of the vector \((X - \mu_\ell)\), and \(\gramian_\ell^{-1}\) is the inverse of the matrix \(\gramian_\ell\).

The volume of this ellipsoid is given by,

\begin{equation} \large V(\ell) = V_\ndim \sqrt{\left| \gramian_\ell \right|} ~, \end{equation}

where \(\left|\gramian_\ell\right|\) is the determinant of \(\gramian_\ell\) and,

\begin{equation} \large V_\ndim = \frac{\pi^{\ndim / 2}}{\up\Gamma(1 + \ndim / 2)} = \begin{cases} \frac{1}{(\ndim/2)!} \pi^{\ndim/2} & \text{if $\ndim$ is even} \\\\ 2^\ndim \frac{1}{\ndim!} \big( \frac{\ndim-1}{2} \big)! ~ \pi^{(\ndim-1)/2} & \text{if $\ndim$ is odd} \end{cases} \end{equation}

is the volume of an \(\ndim\)-ball (that is, a unit-logChoDia \(\ndim\)-dimensional hyper-sphere).
It is readily seen that the corresponding unit-volume ellipsoid \(\widehat\ell\) has the representative Gramian matrix,

\begin{equation} \large \gramian_{\widehat\ell} = V_\ell^{-2/\ndim} ~ \gramian_\ell ~. \end{equation}

More generally, to scale the ellipsoidal support of an MMVUE distribution \(\ell\) by some factor \(\alpha\) along each coordinate axis, it suffices to be used the new scaled ellipsoid \(\ell^*\) with the representative Gramian matrix,

\begin{equation} \large \gramian_{\ell^*} = \alpha^2 ~ \gramian_\ell ~, \end{equation}

in which case, the volume of \(\ell^*\) becomes,

\begin{equation} \large V_{\ell^*} = \alpha^\ndim ~ V_\ell ~. \end{equation}

The Probability Density Function (PDF) of the MMVUE distribution with multiple-ellipsoidal support \(\ell\) is given by,

\begin{equation} \large \pi(X | \ell) = \frac{1}{V(\ell)} = \frac{1}{V_\ndim \sqrt{\left|\gramian_\ell\right|}} ~, \end{equation}

where \(\sqrt{\left|\gramian_\ell\right|}\) represents the union of the volumes of all ellipsoids representing the distribution.
Because there is no closed-form expression for the shared volume of two more overlapping ellipsoids, this union of volumes must be approximated.
Within this module, this approximation is done using a Monte Carlo approach via the generic interface getUnifEllsLogPDF.

Random Number Generation

Note that in an MMVUE distribution, multiple ellipsoids can have partially overlapping support, in which case, the shared support is counted only once in random number generation.
Therefore, the random number generation has to be carefully done so that overlapping ellipsoids are not sampled too often.

The RNG generic interfaces within this module generate uniformly-distributed random vectors from within a single \(\ndim\)-dimensional hyper-ellipsoid by generalizing the proposed approach of Marsaglia (1972) for choosing a point from the surface of a sphere.

  1. Generate a normalized (unit) \(\ndim\)-dimensional Multivariate Normal random vector,

    \begin{equation} \unit{r} = \frac{1}{\sqrt{\sum_{i=1}^\ndim g_i^2}} \sum_{j=1}^{\ndim} g_j \unit{r}_j ~, \end{equation}

    where \(\unit{r}_j\) are the unit vectors representing the orthogonal basis the of \(\ndim\)-space.
    This unit vector \(\unit{r}\) has uniform random orientation and distribution on the surface of an \(\ndim\)-dimensional sphere of unit radius centered at the origin of the coordinate system.
  2. Generate a uniformly-distributed random number \(u\in\mathcal{U}[0,1)\) so that,

    \begin{equation} \bs{r}_{\sphere} = u^{1/\ndim} \unit{r} ~, \end{equation}

    represents a vector pointing to a uniformly-distributed location inside of the \(\ndim\)-sphere.
  3. To obtain a uniformly-distributed vector from inside of an \(\ndim\)-dimensional ellipsoid, first compute the Cholesky decomposition of the representative Gramian matrix \(\gramian\) of the ellipsoid,

    \begin{equation} \gramian = \mat{L}\mat{L}^H ~, \end{equation}

    where \(\mat{L}\) is the left triangular matrix resulting from the Cholesky factorization, and \(\mat{L}^T\) is its Hermitian transpose.
    Then the vector,

    \begin{equation} \bs{r}_\ell = \mat{L} ~ \bs{r}_\sphere + \mu_\ell ~, \end{equation}

    is uniformly distributed inside ellipsoid \(\ell\) centered at \(\mu_\ell\).
Note
  1. An ellipsoid with a diagonal representative Gramian matrix \(\gramian_\ell\) is an uncorrelated hyper-ellipsoid whose axes are parallel to the coordinate axes.
  2. An uncorrelated hyper-ellipsoid with equal diagonal elements in its representative Gramian matrix \(\gramian_\ell\) is a hyper-sphere.

The covariance matrix of a single ellipsoidal support in the MMVUE distribution
The covariance matrix of the multivariate uniform ellipsoidal distribution is given by its Gramian matrix as,

\begin{eqnarray*} \Sigma = \frac{\gramian}{\ndim + 2} ~, \end{eqnarray*}

See also
pm_ellipsoid
pm_distUnif
pm_distNorm
pm_distUnifEll
pm_distUnifPar
pm_distUnifElls
pm_distMultiNorm
Marsaglia G., et al. (1972), Choosing a point from the surface of a sphere. The Annals of Mathematical Statistics 43(2):645-646.
Gammell JD, Barfoot TD (2014) The probability density function of a transformation-based hyper-ellipsoid sampling technique.
Test:
test_pm_distUnifElls


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, April 23, 2017, 1:36 AM, Institute for Computational Engineering and Sciences (ICES), University of Texas at Austin

Variable Documentation

◆ MODULE_NAME

character(*, SK), parameter pm_distUnifElls::MODULE_NAME = "@pm_distUnifElls"

Definition at line 165 of file pm_distUnifElls.F90.