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

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

Data Types

type  distUnifEll_type
 This is the derived type for signifying distributions that are of type MultiVariate Uniform Ellipsoid (MVUE) as defined in the description of pm_distUnifEll. More...
 
interface  getUnifEllLogPDF
 Generate and return the natural logarithm of the Probability Density Function (PDF) of the MultiVariate MVUE (MVUE) Distribution.
More...
 
interface  getUnifEllRand
 Generate and return a (collection) of random vector(s) of size ndim from the ndim-dimensional MultiVariate Uniform Ellipsoidal (MVUE) distribution, optionally with the specified input mean(1:ndim) and the specified subset of the Cholesky Factorization of the Gramian matrix of the MVUE distribution. More...
 
interface  setUnifEllRand
 Return a (collection) of random vector(s) of size ndim from the ndim-dimensional MultiVariate Uniform Ellipsoidal (MVUE) distribution, optionally with the specified input mean(1:ndim) and the specified subset of the Cholesky Factorization of the Gramian matrix of the MVUE distribution. More...
 

Variables

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

Detailed Description

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

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

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

An \(\ndim\)-dimensional MVUE distribution is represented by an \(\ndim\)-dimensional hyper-ellipsoid support.
The MVUE distribution is fully determined by the ellipsoid \(\ell\) containing its support.
The 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 MVUE 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 MVUE distribution with 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}

Random Number Generation

The RNG generic interfaces within this module generate uniformly-distributed random vectors from within an \(\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 the MVUE 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_distMultiNorm
pm_distUnifEll
pm_distUnifPar
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_distUnifEll


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_distUnifEll::MODULE_NAME = "@pm_distUnifEll"

Definition at line 154 of file pm_distUnifEll.F90.