ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
getCDF.m
Go to the documentation of this file.
1%> \brief
2%> Return the corresponding Cumulative Distribution Function (CDF)
3%> of the input random value(s) from the Generalized Gamma distribution.<br>
4%>
5%> \details
6%> A variable \f$X\f$ is said to be **Generalized Gamma** (GenGamma) distributed if its PDF with the **scale** \f$0 < \sigma < +\infty\f$,
7%> **shape** \f$0 < \omega < +\infty\f$, and **shape** \f$0 < \kappa < +\infty\f$ parameters is described by the following equation,
8%>
9%> \f{equation}{
10%> \large
11%> \pi(x | \kappa, \omega, \sigma) =
12%> \frac{1}{\sigma \omega \Gamma(\kappa)} ~
13%> \bigg( \frac{x}{\sigma} \bigg)^{\frac{\kappa}{\omega} - 1} \exp\Bigg( -\bigg(\frac{x}{\sigma}\bigg)^{\frac{1}{\omega}} \Bigg) ~,~ 0 < x < \infty
14%> \f}
15%>
16%> where \f$\eta = \frac{1}{\sigma \omega \Gamma(\kappa)}\f$ is the **normalization factor** of the PDF.<br>
17%> When \f$\sigma = 1\f$, the GenGamma PDF simplifies to the form,
18%>
19%> \f{equation}{
20%> \large
21%> \pi(x) =
22%> \frac{1}{\omega \Gamma(\kappa)} ~
23%> x^{\frac{\kappa}{\omega} - 1} \exp\Bigg( -x^{\frac{1}{\omega}} \Bigg) ~,~ 0 < x < \infty
24%> \f}
25%>
26%> If \f$(\sigma, \omega) = (1, 1)\f$, the GenGamma PDF further simplifies to the form,
27%>
28%> \f{equation}{
29%> \large
30%> \pi(x) =
31%> \frac{1}{\Gamma(\kappa)} ~
32%> x^{\kappa - 1} \exp(-x) ~,~ 0 < x < \infty
33%> \f}
34%>
35%> Setting the shape parameter to \f$\kappa = 1\f$ further simplifies the PDF to the Exponential distribution PDF with the scale parameter \f$\sigma = 1\f$,
36%>
37%> \f{equation}{
38%> \large
39%> \pi(x) = \exp(x) ~,~ 0 < x < \infty
40%> \f}
41%>
42%> <ol>
43%> <li> The parameter \f$\sigma\f$ determines the scale of the GenGamma PDF.<br>
44%> <li> When \f$\omega = 1\f$, the GenGamma PDF reduces to the PDF of the [Gamma distribution](@ref pm_distGamma).<br>
45%> <li> When \f$\kappa = 1, \omega = 1\f$, the GenGamma PDF reduces to the PDF of the [Exponential distribution](@ref pm_distExp).<br>
46%> </ol>
47%>
48%> The **CDF** of the Generalized Gamma distribution over a strictly-positive support \f$x \in (0, +\infty)\f$ with the three (shape, shape, scale)
49%> parameters \f$(\kappa > 0, \omega > 0, \sigma > 0)\f$ is defined by the **regularized** [Lower Incomplete Gamma function](@ref pm_mathGamma) as,
50%> \f{eqnarray}{
51%> \large
52%> \mathrm{CDF}(x | \kappa, \omega, \sigma)
53%> & = & P\bigg(\kappa, \big(\frac{x}{\sigma}\big)^{\frac{1}{\omega}} \bigg) \\
54%> & = & \frac{1}{\Gamma(\kappa)} \int_0^{\big(\frac{x}{\sigma}\big)^{\frac{1}{\omega}}} ~ t^{\kappa - 1}{\mathrm e}^{-t} ~ dt ~,
55%> \f}
56%>
57%> where \f$\Gamma(\kappa)\f$ represents the Gamma function.<br>
58%>
59%> \param[in] x : The input scalar or array of the same shape as other array-valued arguments,
60%> containing the values at which the CDF must be computed.<br>
61%> \param[in] kappa : The input scalar or array of the same shape as other array-valued arguments,
62%> containing the shape parameter (\f$\kappa\f$) of the distribution.<br>
63%> \param[in] invOmega : The input scalar or array of the same shape as other array-valued arguments,
64%> containing the inverse of the second shape parameter (\f$\omega\f$) of the distribution.<br>
65%> \param[in] invSigma : The input scalar or array of the same shape as other array-valued arguments,
66%> containing the inverse of the scale parameter (\f$\sigma\f$) of the distribution.<br>
67%>
68%> \return
69%> `cdf` : The output scalar or array of the same shape as other array-valued input arguments
70%> of the same type and kind as `x` containing the PDF of the specified GenGamma distribution.
71%>
72%> \interface{getCDF}
73%> \code{.m}
74%>
75%> cdf = pm.stats.dist.gengamma.getCDF(x, kappa, invOmega, invSigma)
76%>
77%> \endcode
78%>
79%> \example{getCDF}
80%> \include{lineno} example/stats/dist/gengamma/getCDF/main.m
81%> \output{getCDF}
82%> \include{lineno} example/stats/dist/gengamma/getCDF/main.out.m
83%> \vis{getCDF}
84%> \image html example/stats/dist/gengamma/getCDF/gengamma.getCDF.line.png width=700
85%>
86%> \final{getCDF}
87%>
88%> \author
89%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
90%> \AmirShahmoradi, July 19, 2024, 1:07 AM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
91function cdf = getCDF(x, kappa, invOmega, invSigma)
92 assert(all(0 <= x), 'The condition `all(0 < x)` must hold.');
93 assert(all(0 < kappa), 'The condition `all(0 < kappa)` must hold.');
94 assert(all(0 < invOmega), 'The condition `all(0 < invOmega)` must hold.');
95 assert(all(0 < invSigma), 'The condition `all(0 < invSigma)` must hold.');
96 cdf = gammainc((x .* invSigma).^invOmega, kappa);
97end
function getCDF(in x, in kappa, in invOmega, in invSigma)
Return the corresponding Cumulative Distribution Function (CDF) of the input random value(s) from the...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...