This is the indicator type for generating instances of objects that indicate the integration interval is open and, the integrand has an Integrable square-root type of Singularity at the finite Lower Bound of integration (LBIS).
More...
This is the indicator type for generating instances of objects that indicate the integration interval is open and, the integrand has an Integrable square-root type of Singularity at the finite Lower Bound of integration (LBIS).
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(lbis_type) :: LBIS
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 ⛓
13 real(SP) :: quad_SP, quadref_SP, relerr_SP, alpha_SP, beta_SP
14 real(DP) :: quad_DP, quadref_DP, relerr_DP, alpha_DP, beta_DP
15 real(QP) :: quad_QP, quadref_QP, relerr_QP, alpha_QP, beta_QP
17 type(display_type) :: disp
21 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
22 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
23 call disp%show(
"! Compute the Cumulative Distribution Function (CDF) over an open interval of the Beta distribution with singular support bounds.")
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
29 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
30 call disp%show(
"! Compute the numerical integration with single precision.")
31 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
39 call disp%show(
"quadref_SP = getBetaInc(1._SP, alpha = alpha_SP, beta = beta_SP) - getBetaInc(0._SP, alpha = alpha_SP, beta = beta_SP)")
40 quadref_SP
= getBetaInc(
1._SP, alpha
= alpha_SP, beta
= beta_SP)
- getBetaInc(
0._SP, alpha
= alpha_SP, beta
= beta_SP)
43 call disp%show(
"quad_SP = getQuadRomb(getBetaPDF_SP, 0._SP, .5_SP, epsilon(1.) * 100, 4_IK, lbis_type(real(alpha_SP) - 1.)) + getQuadRomb(getBetaPDF_SP, .5_SP, 1._SP, epsilon(1._SP) * 100, 4_IK, ubis_type(real(beta_SP) - 1.))")
44 quad_SP
= getQuadRomb(getBetaPDF_SP,
0._SP, .
5_SP,
epsilon(
1.)
* 100,
4_IK,
lbis_type(
real(alpha_SP)
- 1.))
+ getQuadRomb(getBetaPDF_SP, .
5_SP,
1._SP,
epsilon(
1._SP)
* 100,
4_IK,
ubis_type(
real(beta_SP)
- 1.))
50 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
51 call disp%show(
"! Compute the numerical integration with double precision.")
52 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
60 call disp%show(
"quadref_DP = getBetaInc(1._DP, alpha = alpha_DP, beta = beta_DP) - getBetaInc(0._DP, alpha = alpha_DP, beta = beta_DP)")
61 quadref_DP
= getBetaInc(
1._DP, alpha
= alpha_DP, beta
= beta_DP)
- getBetaInc(
0._DP, alpha
= alpha_DP, beta
= beta_DP)
64 call disp%show(
"quad_DP = getQuadRomb(getBetaPDF_DP, 0._DP, .5_DP, epsilon(1._DP) * 100, 10_IK, lbis_type(real(alpha_DP) - 1.)) + getQuadRomb(getBetaPDF_DP, .5_DP, 1._DP, epsilon(1._DP) * 100, 5_IK, ubis_type(real(beta_DP) - 1.))")
65 quad_DP
= getQuadRomb(getBetaPDF_DP,
0._DP, .
5_DP,
epsilon(
1._DP)
* 100,
10_IK,
lbis_type(
real(alpha_DP)
- 1.))
+ getQuadRomb(getBetaPDF_DP, .
5_DP,
1._DP,
epsilon(
1._DP)
* 100,
5_IK,
ubis_type(
real(beta_DP)
- 1.))
71 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
72 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
73 call disp%show(
"! Compute the integral of 1/sqrt(abs(x)) = 4 over the interval [-1, 1] with a singularity at x = 0.")
74 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
75 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
79 call disp%show(
"quad_DP = getQuadRomb(getInvSqrtAbs_DP, -1._DP, 0._DP, epsilon(1._DP) * 100, 7_IK, ubis_type(-0.5)) + getQuadRomb(getInvSqrtAbs_DP, 0._DP, 1._DP, epsilon(1._DP) * 100, 10_IK, lbis_type(-0.5))")
80 quad_DP
= getQuadRomb(getInvSqrtAbs_DP,
-1._DP,
0._DP,
epsilon(
1._DP)
* 100,
7_IK,
ubis_type(
-0.5))
+ getQuadRomb(getInvSqrtAbs_DP,
0._DP,
1._DP,
epsilon(
1._DP)
* 100,
10_IK,
lbis_type(
-0.5))
86 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
88 call disp%show(
"! Compute the integral of 1/sqrt(abs(x)) = 4 over the interval [-1, 1] with a singularity at x = 0.")
89 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
90 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
94 call disp%show(
"quad_QP = getQuadRomb(getInvSqrtAbs_DP, -1._QP, 0._QP, epsilon(1._QP) * 100, 7_IK, ubis_type(-0.5)) + getQuadRomb(getInvSqrtAbs_QP, 0._QP, 1._QP, epsilon(1._QP) * 100, 10_IK, lbis_type(-0.5))")
95 quad_QP
= getQuadRomb(getInvSqrtAbs_QP,
-1._QP,
0._QP,
epsilon(
1._QP)
* 100,
7_IK,
ubis_type(
-0.5))
+ getQuadRomb(getInvSqrtAbs_QP,
0._QP,
1._QP,
epsilon(
1._QP)
* 100,
10_IK,
lbis_type(
-0.5))
102 function getBetaPDF_SP(x)
result(betaPDF)
103 real ,
intent(in) :: x
105 betaPDF
= getBetaPDF(x, alpha
= alpha_SP, beta
= beta_SP)
108 function getBetaPDF_DP(x)
result(betaPDF)
109 real(DP),
intent(in) :: x
111 betaPDF
= getBetaPDF(x, alpha
= alpha_DP, beta
= beta_DP)
114 function getBetaPDF_QP(x)
result(betaPDF)
115 real(QP),
intent(in) :: x
117 betaPDF
= getBetaPDF(x, alpha
= alpha_QP, beta
= beta_QP)
120 pure function getInvSqrtAbs_DP(x)
result(invSqrtAbs)
121 real(DP),
intent(in) :: x
122 real(DP) :: invSqrtAbs
123 invSqrtAbs
= 1._DP / sqrt(abs(x))
126 pure function getInvSqrtAbs_QP(x)
result(invSqrtAbs)
127 real(QP),
intent(in) :: x
128 real(QP) :: invSqrtAbs
129 invSqrtAbs
= 1._QP / sqrt(abs(x))
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 type-parameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
This module contains classes and procedures for computing the mathematical Beta Function and its inve...
Generate and return an object of type display_type.
This is the indicator type for generating instances of objects that indicate the integration interval...
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 ⛓
16quadref_SP
= getBetaInc(
1._SP, alpha
= alpha_SP, beta
= beta_SP)
- getBetaInc(
0._SP, alpha
= alpha_SP, beta
= beta_SP)
19quad_SP
= getQuadRomb(getBetaPDF_SP,
0._SP, .
5_SP,
epsilon(
1.)
* 100,
4_IK,
lbis_type(
real(alpha_SP)
- 1.))
+ getQuadRomb(getBetaPDF_SP, .
5_SP,
1._SP,
epsilon(
1._SP)
* 100,
4_IK,
ubis_type(
real(beta_SP)
- 1.))
31quadref_DP
= getBetaInc(
1._DP, alpha
= alpha_DP, beta
= beta_DP)
- getBetaInc(
0._DP, alpha
= alpha_DP, beta
= beta_DP)
34quad_DP
= getQuadRomb(getBetaPDF_DP,
0._DP, .
5_DP,
epsilon(
1._DP)
* 100,
10_IK,
lbis_type(
real(alpha_DP)
- 1.))
+ getQuadRomb(getBetaPDF_DP, .
5_DP,
1._DP,
epsilon(
1._DP)
* 100,
5_IK,
ubis_type(
real(beta_DP)
- 1.))
46quad_DP
= getQuadRomb(getInvSqrtAbs_DP,
-1._DP,
0._DP,
epsilon(
1._DP)
* 100,
7_IK,
ubis_type(
-0.5))
+ getQuadRomb(getInvSqrtAbs_DP,
0._DP,
1._DP,
epsilon(
1._DP)
* 100,
10_IK,
lbis_type(
-0.5))
58quad_QP
= getQuadRomb(getInvSqrtAbs_DP,
-1._QP,
0._QP,
epsilon(
1._QP)
* 100,
7_IK,
ubis_type(
-0.5))
+ getQuadRomb(getInvSqrtAbs_QP,
0._QP,
1._QP,
epsilon(
1._QP)
* 100,
10_IK,
lbis_type(
-0.5))
60+4.00000000000000000000000000000000000
- 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 at Austin
Definition at line 256 of file pm_quadRomb.F90.