This is the indicator type for generating instances of objects that indicate the integration interval is open.
More...
This is the indicator type for generating instances of objects that indicate the integration interval is open.
This is an empty derived type that exists solely for generating unique objects that are distinguishable as input arguments to procedures under the generic interface getQuadRomb.
Possible calling interfaces ⛓
type(open_type) :: Open
This module contains classes and procedures to perform numerical integrations.
This is the indicator type for generating instances of objects that indicate the integration interval...
 See also
 lbis_type
nexp_type
open_type
pexp_type
pwrl_type
ubis_type
getQuadRomb
Example usage ⛓
11 integer,
parameter :: SP
= kind(
0.e0), DP
= kind(
0.d0)
15 real(SP) :: quad_sp, quadref_sp, relerr_sp, alpha_sp, beta_sp
16 real(DP) :: quad_dp, quadref_dp, relerr_dp, alpha_dp, beta_dp
17 real(QP) :: quad_qp, quadref_qp, relerr_qp, alpha_qp, beta_qp
19 type(display_type) :: disp
23 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"! Compute the Cumulative Distribution Function (CDF) over an open interval of the Beta distribution by numerical integration.")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
31 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
32 call disp%show(
"! Compute the numerical integration with single precision.")
33 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
41 call disp%show(
"quadref_sp = getBetaInc(1., alpha = alpha_sp, beta = beta_sp)  getBetaInc(0., alpha = alpha_sp, beta = beta_sp)")
42 quadref_sp
= getBetaInc(
1., alpha
= alpha_sp, beta
= beta_sp)
 getBetaInc(
0., alpha
= alpha_sp, beta
= beta_sp)
45 call disp%show(
"quad_sp = getQuadRomb(getFunc = getBetaPDF_SP, lb = 0., ub = 1., tol = epsilon(1.) * 100, nref = 4_IK, interval = open_type(), relerr = relerr_sp, neval = neval)")
46 quad_sp
= getQuadRomb(getFunc
= getBetaPDF_SP, lb
= 0., ub
= 1., tol
= epsilon(
1.)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_sp, neval
= neval)
47 call disp%show(
"if (relerr_sp < 0.) error stop 'Integration failed to converge.'")
48 if (relerr_sp
< 0.)
error stop 'Integration failed to converge.'
49 call disp%show(
"relerr_sp ! < 0. if integration fails.")
51 call disp%show(
"neval ! # calls to the integrand.")
58 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
59 call disp%show(
"! Compute the numerical integration with double precision.")
60 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
68 call disp%show(
"quadref_dp = getBetaInc(1.d0, alpha = alpha_dp, beta = beta_dp)  getBetaInc(0.d0, alpha = alpha_dp, beta = beta_dp)")
69 quadref_dp
= getBetaInc(
1.d0, alpha
= alpha_dp, beta
= beta_dp)
 getBetaInc(
0.d0, alpha
= alpha_dp, beta
= beta_dp)
72 call disp%show(
"quad_dp = getQuadRomb(getFunc = getBetaPDF_DP, lb = 0.d0, ub = 1.d0, tol = epsilon(1.d0) * 100, nref = 4_IK, interval = open_type(), relerr = relerr_dp, neval = neval)")
73 quad_dp
= getQuadRomb(getFunc
= getBetaPDF_DP, lb
= 0.d0, ub
= 1.d0, tol
= epsilon(
1.d0)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_dp, neval
= neval)
74 call disp%show(
"if (relerr_dp < 0.) error stop 'Integration failed to converge.'")
75 if (relerr_dp
< 0.)
error stop 'Integration failed to converge.'
76 call disp%show(
"relerr_dp ! < 0. if integration fails.")
78 call disp%show(
"neval ! # calls to the integrand.")
85 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
86 call disp%show(
"! Compute the numerical integration with quadro precision.")
87 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
95 call disp%show(
"quadref_qp = getBetaInc(1._QP, alpha = alpha_qp, beta = beta_qp)  getBetaInc(0._QP, alpha = alpha_qp, beta = beta_qp)")
96 quadref_qp
= getBetaInc(
1._QP, alpha
= alpha_qp, beta
= beta_qp)
 getBetaInc(
0._QP, alpha
= alpha_qp, beta
= beta_qp)
99 call disp%show(
"quad_qp = getQuadRomb(getFunc = getBetaPDF_QP, lb = 0._QP, ub = 1._QP, tol = epsilon(1._QP) * 100, nref = 4_IK, interval = open_type(), relerr = relerr_qp, neval = neval)")
100 quad_qp
= getQuadRomb(getFunc
= getBetaPDF_QP, lb
= 0._QP, ub
= 1._QP, tol
= epsilon(
1._QP)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_qp, neval
= neval)
101 call disp%show(
"if (relerr_qp < 0.) error stop 'Integration failed to converge.'")
102 if (relerr_qp
< 0.)
error stop 'Integration failed to converge.'
103 call disp%show(
"relerr_qp ! < 0. if integration fails.")
105 call disp%show(
"neval ! # calls to the integrand.")
107 call disp%show(
"quad_qp ! integral")
113 function getBetaPDF_SP(x)
result(betaPDF)
114 real ,
intent(in) :: x
116 betaPDF
= getBetaPDF(x, alpha
= alpha_sp, beta
= beta_sp)
119 function getBetaPDF_DP(x)
result(betaPDF)
120 real(DP),
intent(in) :: x
122 betaPDF
= getBetaPDF(x, alpha
= alpha_dp, beta
= beta_dp)
125 function getBetaPDF_QP(x)
result(betaPDF)
126 real(QP),
intent(in) :: x
128 betaPDF
= getBetaPDF(x, alpha
= alpha_qp, beta
= beta_qp)
Generate and return the Probability Density Function (PDF) of the Beta distribution for an input x wi...
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.
Generate and return the regularized Incomplete Beta Function as defined in the details section of pm...
Generate and return the integral of the input function getFunc() in the closed range [lb,...
This module contains classes and procedures for computing various statistical quantities related to t...
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 typeparameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in CFortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in CFortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highestprecision real kind t...
This module contains classes and procedures for computing the mathematical Beta Function and its inve...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort fpp standardsemantics 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 /standardsemantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran cpp ffreelinelengthnone O3 Wl,rpath,../../../lib I../../../inc main.F90 ../../../lib/libparamonte* o main.exe
Example output ⛓
16quadref_sp
= getBetaInc(
1., alpha
= alpha_sp, beta
= beta_sp)
 getBetaInc(
0., alpha
= alpha_sp, beta
= beta_sp)
19quad_sp
= getQuadRomb(getFunc
= getBetaPDF_SP, lb
= 0., ub
= 1., tol
= epsilon(
1.)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_sp, neval
= neval)
20if (relerr_sp
< 0.)
error stop 'Integration failed to converge.'
36quadref_dp
= getBetaInc(
1.d0, alpha
= alpha_dp, beta
= beta_dp)
 getBetaInc(
0.d0, alpha
= alpha_dp, beta
= beta_dp)
39quad_dp
= getQuadRomb(getFunc
= getBetaPDF_DP, lb
= 0.d0, ub
= 1.d0, tol
= epsilon(
1.d0)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_dp, neval
= neval)
40if (relerr_dp
< 0.)
error stop 'Integration failed to converge.'
42+0.82208736155494289E19
56quadref_qp
= getBetaInc(
1._QP, alpha
= alpha_qp, beta
= beta_qp)
 getBetaInc(
0._QP, alpha
= alpha_qp, beta
= beta_qp)
58+1.00000000000000000000000000000000000
59quad_qp
= getQuadRomb(getFunc
= getBetaPDF_QP, lb
= 0._QP, ub
= 1._QP, tol
= epsilon(
1._QP)
* 100, nref
= 4_IK, interval
= open_type(), relerr
= relerr_qp, neval
= neval)
60if (relerr_qp
< 0.)
error stop 'Integration failed to converge.'
62+0.536593794869866187703530942375956851E36
66+1.00000000000000000000000000000000019
 Test:
 test_pm_quadRomb
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, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin
Definition at line 78 of file pm_quadRomb.F90.