Generate and return the natural logarithm of the normalization factor of the Probability Density Function (PDF) of the GenGamma distribution.
More...
Generate and return the natural logarithm of the normalization factor of the Probability Density Function (PDF) of the GenGamma distribution.
The normalization factor of the GenGamma PDF is defined as \(\eta = 1 / (\sigma \omega \Gamma(\kappa))\) where \((\omega, \kappa)\) are the scale and shape parameters of the GenGamma distribution, respectively.
For more information, see the documentation of pm_distGenGamma.
- Parameters
-
[in] | kappa | : The input scalar or array of the same shape as other array-like arguments, containing the shape parameter ( \(\kappa\)) of the distribution.
|
[in] | invOmega | : The input scalar or array of the same shape as other array-like arguments, containing the inverse of the second shape parameter ( \(\omega\)) of the distribution.
(optional, default = 1. . It must be present if invSigma is also present.) |
[in] | invSigma | : The input scalar or array of the same shape as other array-valued arguments, containing the inverse of the scale parameter ( \(\sigma\)) of the distribution.
(optional, default = 1. ) |
- Returns
logPDFNF
: The output scalar or array of the same shape as array-like input arguments, of the same type, kind, and highest rank as the input arguments containing the natural logarithm of the normalization factor of the distribution.
Possible calling interfaces ⛓
Generate and return the natural logarithm of the normalization factor of the Probability Density Func...
This module contains classes and procedures for computing various statistical quantities related to t...
- Warning
- The conditions
kappa > 0
, invOmega > 0
, and invSigma > 0
must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- See also
- getGenGammaLogPDF
setGenGammaLogPDF
Example usage ⛓
13 integer(IK) ,
parameter :: NP
= 1000_IK
14 real(RK) ,
allocatable :: invSigma(:), invOmega(:), Kappa(:), logPDFNF(:)
16 type(display_type) :: disp
22 allocate(logPDFNF,
mold = Kappa)
25 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%show(
"! Compute the natural logarithm of the normalization factor of the GenGamma distribution PDF.")
28 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
29 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
33 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
34 call disp%show(
"! Compute the PDF at an input scalar real value.")
35 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
41 call disp%show(
"logPDFNF(1) = getGenGammaLogPDFNF(kappa = Kappa(1))")
52 call disp%show(
"logPDFNF(1) = getGenGammaLogPDFNF(Kappa(1), invOmega(1))")
65 call disp%show(
"logPDFNF(1) = getGenGammaLogPDFNF(Kappa(1), invOmega(1), invSigma(1))")
72 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
73 call disp%show(
"! Compute the PDF at at a mix of scalar and vector input values.")
74 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
80 call disp%show(
"logPDFNF(1:NP:NP/5) = getGenGammaLogPDFNF(Kappa(1:NP:NP/5))")
82 call disp%show(
"logPDFNF(1:NP:NP/5)")
83 call disp%show( logPDFNF(
1:NP:NP
/5) )
89 call disp%show(
"logPDFNF(1:NP:NP/5) = getGenGammaLogPDFNF(Kappa(1:NP:NP/5), 1._RK)")
91 call disp%show(
"logPDFNF(1:NP:NP/5)")
92 call disp%show( logPDFNF(
1:NP:NP
/5) )
98 call disp%show(
"invOmega(1:NP:NP/5)")
99 call disp%show( invOmega(
1:NP:NP
/5) )
100 call disp%show(
"logPDFNF(1:NP:NP/5) = getGenGammaLogPDFNF(1._RK, invOmega(1:NP:NP/5))")
102 call disp%show(
"logPDFNF(1:NP:NP/5)")
103 call disp%show( logPDFNF(
1:NP:NP
/5) )
109 call disp%show(
"invOmega(1:NP:NP/5)")
110 call disp%show( invOmega(
1:NP:NP
/5) )
111 call disp%show(
"logPDFNF(1:NP:NP/5) = getGenGammaLogPDFNF(Kappa(1:NP:NP/5), invOmega(1:NP:NP/5))")
113 call disp%show(
"logPDFNF(1:NP:NP/5)")
114 call disp%show( logPDFNF(
1:NP:NP
/5) )
120 call disp%show(
"invOmega(1:NP:NP/5)")
121 call disp%show( invOmega(
1:NP:NP
/5) )
122 call disp%show(
"invSigma(1:NP:NP/5)")
123 call disp%show( invSigma(
1:NP:NP
/5) )
124 call disp%show(
"logPDFNF(1:NP:NP/5) = getGenGammaLogPDFNF(Kappa(1:NP:NP/5), invOmega(1:NP:NP/5), invSigma(1:NP:NP/5))")
125 logPDFNF(
1:NP:NP
/5)
= getGenGammaLogPDFNF(Kappa(
1:NP:NP
/5), invOmega(
1:NP:NP
/5), invSigma(
1:NP:NP
/5))
126 call disp%show(
"logPDFNF(1:NP:NP/5)")
127 call disp%show( logPDFNF(
1:NP:NP
/5) )
135 integer :: fileUnit, i
137 open(newunit
= fileUnit, file
= "getGenGammaLogPDFNF.RK.txt")
138 write(fileUnit,
"(2(g0,:,' '))") (Kappa(i),
exp(logPDFNF(i)), i
= 1,
size(logPDFNF))
Generate count evenly spaced points over the interval [x1, x2] if x1 < x2, or [x2,...
Return the linSpace output argument with size(linSpace) elements of evenly-spaced values over the int...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains procedures and generic interfaces for generating arrays with linear or logarithm...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
47+0.999999978E-2,
+2.00999999,
+4.01000023,
+6.01000023,
+8.01000023
50-4.59948015,
-0.426001893E-2,
-1.80433512,
-4.80456209,
-8.54532528
54+0.999999978E-2,
+2.00999999,
+4.01000023,
+6.01000023,
+8.01000023
57-4.59948015,
-0.426001893E-2,
-1.80433512,
-4.80456209,
-8.54532528
61+0.999999978E-2,
+2.00999999,
+4.01000023,
+6.01000023,
+8.01000023
63+0.100000001,
+2.08198190,
+4.06396389,
+6.04594564,
+8.02792740
66-2.30258512,
+0.733320296,
+1.40215886,
+1.79938793,
+2.08292627
70+0.999999978E-2,
+2.00999999,
+4.01000023,
+6.01000023,
+8.01000023
72+0.100000001,
+2.08198190,
+4.06396389,
+6.04594564,
+8.02792740
75-6.90206528,
+0.729060292,
-0.402176261,
-3.00517416,
-6.46239901
79+0.999999978E-2,
+2.00999999,
+4.01000023,
+6.01000023,
+8.01000023
81+0.100000001,
+2.08198190,
+4.06396389,
+6.04594564,
+8.02792740
83+0.100000001,
+2.08198190,
+4.06396389,
+6.04594564,
+8.02792740
84logPDFNF(
1:NP:NP
/5)
= getGenGammaLogPDFNF(Kappa(
1:NP:NP
/5), invOmega(
1:NP:NP
/5), invSigma(
1:NP:NP
/5))
86-9.20465088,
+1.46238065,
+0.999982595,
-1.20578623,
-4.37947273
Postprocessing of the example output ⛓
3import matplotlib.pyplot
as plt
15xlab = {
"CK" :
r"shape parameter: $\kappa$ ( real/imaginary )"
16 ,
"IK" :
r"shape parameter: $\kappa$ ( integer-valued )"
17 ,
"RK" :
r"shape parameter: $\kappa$ ( real-valued )"
20for kind
in [
"IK",
"CK",
"RK"]:
22 pattern =
"*." + kind +
".txt"
23 fileList = glob.glob(pattern)
24 if len(fileList) == 1:
26 df = pd.read_csv(fileList[0], delimiter =
" ")
28 fig = plt.figure(figsize = 1.25 * np.array([6.4, 4.8]), dpi = 200)
32 plt.plot( df.values[:, 0]
37 plt.plot( df.values[:, 1]
43 plt.plot( df.values[:, 0]
49 plt.xticks(fontsize = fontsize - 2)
50 plt.yticks(fontsize = fontsize - 2)
51 ax.set_xlabel(xlab[kind], fontsize = fontsize)
52 ax.set_ylabel(
"Normalization Factor of the PDF", fontsize = fontsize)
56 plt.grid(visible =
True, which =
"both", axis =
"both", color =
"0.85", linestyle =
"-")
57 ax.tick_params(axis =
"y", which =
"minor")
58 ax.tick_params(axis =
"x", which =
"minor")
60 plt.savefig(fileList[0].replace(
".txt",
".png"))
62 elif len(fileList) > 1:
64 sys.exit(
"Ambiguous file list exists.")
Visualization of the example output ⛓
- Test:
- test_pm_distGenGamma
- Todo:
- Normal Priority: This generic interface can be extended to
complex
arguments.
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.
-
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.
-
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.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, Oct 16, 2009, 11:14 AM, Michigan
Definition at line 250 of file pm_distGenGamma.F90.