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

This module contains classes and procedures for computing various statistical quantities related to the Cyclic Geometric distribution. More...

Data Types

type  distGeomCyclic_type
 This is the derived type for signifying distributions that are of type Cyclic Geometric as defined in the description of pm_distGeomCyclic. More...
 
interface  getGeomCyclicLogCDF
 Generate and return the natural logarithm of the Cumulative Distribution Function (CDF) of the Cyclic Geometric distribution for an input stepSuccess within the discrete integer support of the distribution \([0, period]\). More...
 
interface  getGeomCyclicLogPMF
 Generate and return the natural logarithm of the Probability Mass Function (PMF) of the Cyclic Geometric distribution for an input stepSuccess within the discrete integer support of the distribution \([0, \ms{period}]\). More...
 
interface  getGeomCyclicRand
 Generate and return a scalar (or array of arbitrary rank of) random value(s) from the Cyclic Geometric distribution.
More...
 
interface  isFailedGeomCyclicFit
 Generate and return .true. if the parameters of a least-squares fit to the histogram representing a Cyclic-Geometric-distributed sample can be successfully inferred, otherwise, return .false..
More...
 
interface  setGeomCyclicLogCDF
 Return the natural logarithm of the Cumulative Distribution Function (CDF) of the Cyclic Geometric distribution for an input stepSuccess within the discrete integer support of the distribution \([0, period]\). More...
 
interface  setGeomCyclicLogPMF
 Return the natural logarithm of the Probability Mass Function (PMF) of the Cyclic Geometric distribution for an input stepSuccess within the discrete integer support of the distribution \([0, period]\). More...
 
interface  setGeomCyclicRand
 Return a scalar (or array of arbitrary rank of) random value(s) from the Cyclic Geometric distribution.
More...
 

Variables

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

Detailed Description

This module contains classes and procedures for computing various statistical quantities related to the Cyclic Geometric distribution.

Specifically, this module contains routines for computing the following quantities of the Cyclic Geometric distribution:

  1. the Probability Mass Function (PMF)
  2. the Cumulative Distribution Function (CDF)
  3. the Random Number Generation from the distribution (RNG)
  4. the Inverse Cumulative Distribution Function (ICDF) or the Quantile Function

The Cyclic Geometric distribution is defined similar to the Geometric distribution, except for the fact that there is an upper limit to the number of Bernoulli trials in the experiment.
Once the upper limit is reached without any success, the experiment recycles to the first Bernoulli trial and the process repeats until the first success occurs.
The Cyclic Geometric distribution appears in the computation of the workload of the different processes in a parallel application, for example, the ParaMonte sampler parallel simulations.

Probability Mass Function (PMF)

If the probability of success on each trial is \(\ms{probSuccess}\), then the probability that the \(\ms{stepSuccess}^{th}\) trial is the first success in a cyclic trial set with a cycle \(\ms{period}\) can be written in terms of the PMF of the Geometric distribution as,

\begin{eqnarray} \large \pi_{\mathcal{CG}} (X = \ms{stepSuccess} ~|~ \ms{probSuccess}, \ms{period}) &=& \sum_{i = 0}^{+\infty} ~ \pi_{\mathcal{G}} (X = i \times \ms{period} + \ms{stepSuccess} ~|~ \ms{probSuccess}) ~, \nonumber \\ &=& \frac{\ms{probSuccess} (1 - \ms{probSuccess})^{\ms{stepSuccess} - 1}}{1 - (1 - \ms{probSuccess})^{\ms{period}}} ~, \end{eqnarray}

where,

  1. \(\pi_{\mathcal{CG}} (\cdot)\) refers to the Cyclic Geometric distribution and,
  2. \(\pi_{\mathcal{G}} (\cdot)\) refers to the Geometric distribution,

Cumulative Distribution Function (CDF)

The CDF of the distribution can be computed as a finite Geometric series,

\begin{eqnarray} \ms{CDF}(X = \ms{stepSuccess} ~|~ \ms{probSuccess}, \ms{period}) &=& \sum_{i = 0}^{\ms{period}} ~ \pi_{\mathcal{CG}} (X = i ~|~ \ms{probSuccess}, \ms{period}) ~, \nonumber \\ &=& \frac{1 - (1 - \ms{probSuccess})^{\ms{stepSuccess}}}{1 - (1 - \ms{probSuccess})^{\ms{period}}} ~, \end{eqnarray}

See Amir Shahmoradi, Fatemeh Bagheri (2020). ParaDRAM: A Cross-Language Toolbox for Parallel High-Performance Delayed-Rejection Adaptive Metropolis Markov Chain Monte Carlo Simulations. for details of the derivation of the above PMF.

See also
pm_distGeom
Amir Shahmoradi, Fatemeh Bagheri (2020). ParaDRAM: A Cross-Language Toolbox for Parallel High-Performance Delayed-Rejection Adaptive Metropolis Markov Chain Monte Carlo Simulations.
Test:
test_pm_distGeomCyclic


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, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.

Variable Documentation

◆ MODULE_NAME

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

Definition at line 87 of file pm_distGeomCyclic.F90.