ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_quadRomb::ubis_type Type Reference

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...

Public Attributes

real exponent = 0.5
 

Detailed Description

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(ubis_type) :: UBIS
This module contains classes and procedures to perform numerical integrations.
Definition: pm_quadRomb.F90:31
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

1program example
2
3 use pm_kind, only: SK, IK, SP => RKS, DP => RKD, QP => RKH ! all real kinds are supported.
4 use pm_mathBeta, only: getBetaInc
5 use pm_distBeta, only: getBetaPDF
7 use pm_io, only: display_type
8
9 implicit none
10
11 integer(IK) :: neval
12
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
16
17 type(display_type) :: disp
18 disp = display_type(file = "main.out.F90")
19
20 call disp%skip()
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("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
26 call disp%skip()
27
28 call disp%skip()
29 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
30 call disp%show("! Compute the numerical integration with single precision.")
31 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
32 call disp%skip()
33
34 call disp%skip()
35 call disp%show("alpha_SP = .5_SP")
36 alpha_SP = .5_SP
37 call disp%show("beta_SP = .5_SP")
38 beta_SP = .5_SP
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)
41 call disp%show("quadref_SP")
42 call disp%show( quadref_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.))
45 call disp%show("quad_SP ! integral")
46 call disp%show( quad_SP )
47 call disp%skip()
48
49 call disp%skip()
50 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
51 call disp%show("! Compute the numerical integration with double precision.")
52 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
53 call disp%skip()
54
55 call disp%skip()
56 call disp%show("alpha_DP = .5_DP")
57 alpha_DP = .5_DP
58 call disp%show("beta_DP = .5_DP")
59 beta_DP = .5_DP
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)
62 call disp%show("quadref_DP")
63 call disp%show( quadref_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, 10_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, 10_IK, ubis_type(real(beta_DP) - 1.))
66 call disp%show("quad_DP ! integral")
67 call disp%show( quad_DP )
68 call disp%skip()
69
70 call disp%skip()
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 alpha singularity at x = 0.")
74 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
75 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
76 call disp%skip()
77
78 call disp%skip()
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))
81 call disp%show("quad_DP ! integral")
82 call disp%show( quad_DP )
83 call disp%skip()
84
85 call disp%skip()
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 alpha singularity at x = 0.")
89 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
90 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
91 call disp%skip()
92
93 call disp%skip()
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))
96 call disp%show("quad_QP ! integral")
97 call disp%show( quad_QP )
98 call disp%skip()
99
100contains
101
102 function getBetaPDF_SP(x) result(betaPDF)
103 real , intent(in) :: x
104 real :: betaPDF
105 betaPDF = getBetaPDF(x, alpha = alpha_SP, beta = beta_SP)
106 end function
107
108 function getBetaPDF_DP(x) result(betaPDF)
109 real(DP), intent(in) :: x
110 real(DP) :: betaPDF
111 betaPDF = getBetaPDF(x, alpha = alpha_DP, beta = beta_DP)
112 end function
113
114 function getBetaPDF_QP(x) result(betaPDF)
115 real(QP), intent(in) :: x
116 real(QP) :: betaPDF
117 betaPDF = getBetaPDF(x, alpha = alpha_QP, beta = beta_QP)
118 end function
119
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))
124 end function
125
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))
130 end function
131
132end program example
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.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
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...
Definition: pm_distBeta.F90:99
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter RKD
The double precision real kind in Fortran mode. On most platforms, this is an 64-bit real kind.
Definition: pm_kind.F90:568
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
Definition: pm_kind.F90:858
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
This module contains classes and procedures for computing the mathematical Beta Function and its inve...
Definition: pm_mathBeta.F90:84
Generate and return an object of type display_type.
Definition: pm_io.F90:10282
This is the indicator type for generating instances of objects that indicate the integration interval...

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4! Compute the Cumulative Distribution Function (CDF) over an open interval of the Beta distribution with singular support bounds.
5!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
8
9!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10! Compute the numerical integration with single precision.
11!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13
14alpha_SP = .5_SP
15beta_SP = .5_SP
16quadref_SP = getBetaInc(1._SP, alpha = alpha_SP, beta = beta_SP) - getBetaInc(0._SP, alpha = alpha_SP, beta = beta_SP)
17quadref_SP
18+1.00000000
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.))
20quad_SP ! integral
21+0.999999046
22
23
24!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25! Compute the numerical integration with double precision.
26!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28
29alpha_DP = .5_DP
30beta_DP = .5_DP
31quadref_DP = getBetaInc(1._DP, alpha = alpha_DP, beta = beta_DP) - getBetaInc(0._DP, alpha = alpha_DP, beta = beta_DP)
32quadref_DP
33+1.0000000000000000
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, 10_IK, ubis_type(real(beta_DP) - 1.))
35quad_DP ! integral
36+1.0000000000022546
37
38
39!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41! Compute the integral of 1/sqrt(abs(x)) = 4 over the interval [-1, 1] with alpha singularity at x = 0.
42!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
45
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))
47quad_DP ! integral
48+4.0000000000000000
49
50
51!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53! Compute the integral of 1/sqrt(abs(x)) = 4 over the interval [-1, 1] with alpha singularity at x = 0.
54!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
57
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))
59quad_QP ! integral
60+4.00000000000000000000000000000000000
61
62
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.

  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, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 300 of file pm_quadRomb.F90.

Member Data Documentation

◆ exponent

real pm_quadRomb::ubis_type::exponent = 0.5

Definition at line 301 of file pm_quadRomb.F90.


The documentation for this type was generated from the following file: