17 integer(IK) :: iprob, ndim, nsam, itry, ntry
= 5
18 integer(IK),
allocatable :: iweight(:)
19 type(display_type) :: disp
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"!1D sample quantile.")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%")
31 real(TKG),
allocatable :: sample(:), prob(:), quan(:)
33 call disp%show(
"sample = [10, 7, 4, 3, 2, 1, 0]")
34 sample
= [
10,
7,
4,
3,
2,
1,
0]
35 call disp%show(
"prob = [0., .25, .5, .75, .9, 1.]")
36 prob
= [
0., .
25, .
5, .
75, .
9,
1.]
37 call disp%show(
"quan = getQuan(neimean, prob, sample)")
41 call disp%show(
"quan = getQuan(neinear, prob, sample)")
45 call disp%show(
"quan = getQuan(neinext, prob, sample)")
49 call disp%show(
"quan = getQuan(neiprev, prob, sample)")
53 call disp%show(
"quan = getQuan(piwilin, prob, sample)")
57 call disp%show(
"do iprob = 1, size(prob)")
58 call disp%show(
" quan(iprob) = getQuan(piwilin, prob(iprob), sample)")
60 do iprob
= 1,
size(prob)
69 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
70 call disp%show(
"!1D frequency/reliability-weighted sample quantile.")
71 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
76 real(TKG),
allocatable :: sample(:), prob(:), quan(:)
78 call disp%show(
"sample = [10, 7, 4, 3, 2, 1, 0]")
79 sample
= [
10,
7,
4,
3,
2,
1,
0]
80 call disp%show(
"iweight = getUnifRand(1, 9, size(sample, 1, IK))")
84 call disp%show(
"prob = [0., .25, .5, .75, .9, 1.]")
85 prob
= [
0., .
25, .
5, .
75, .
9,
1.]
86 call disp%show(
"quan = getQuan(neimean, prob, sample)")
90 call disp%show(
"quan = getQuan(neinear, prob, sample, iweight)")
94 call disp%show(
"quan = getQuan(neinext, prob, sample, iweight)")
98 call disp%show(
"quan = getQuan(neiprev, prob, sample, iweight)")
102 call disp%show(
"quan = getQuan(piwilin, prob, sample, iweight, sum(iweight))")
106 call disp%show(
"do iprob = 1, size(prob)")
107 call disp%show(
" quan(iprob) = getQuan(piwilin, prob(iprob), sample, iweight)")
109 do iprob
= 1,
size(prob)
119 real(TKG),
allocatable :: sample(:), prob(:), quan(:)
120 real(TKG),
allocatable :: rweight(:)
122 call disp%show(
"sample = [10, 7, 4, 3, 2, 1, 0]")
123 sample
= [
10,
7,
4,
3,
2,
1,
0]
124 call disp%show(
"rweight = exp(getNormLogPDF(getFilled(0._TKG, size(sample, 1, IK))))")
128 call disp%show(
"prob = [0., .25, .5, .75, .9, 1.]")
129 prob
= [
0., .
25, .
5, .
75, .
9,
1.]
130 call disp%show(
"quan = getQuan(neimean, prob, sample)")
134 call disp%show(
"quan = getQuan(neinear, prob, sample, rweight)")
138 call disp%show(
"quan = getQuan(neinext, prob, sample, rweight)")
142 call disp%show(
"quan = getQuan(neiprev, prob, sample, rweight)")
146 call disp%show(
"quan = getQuan(piwilin, prob, sample, rweight, sum(rweight))")
150 call disp%show(
"do iprob = 1, size(prob)")
151 call disp%show(
" quan(iprob) = getQuan(piwilin, prob(iprob), sample, rweight)")
153 do iprob
= 1,
size(prob)
162 call disp%show(
"!%%%%%%%%%%%%%%%%%%%")
163 call disp%show(
"!2D sample quantile.")
164 call disp%show(
"!%%%%%%%%%%%%%%%%%%%")
169 real(TKG),
allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
170 integer(IK) :: nsam, nprob, dim
172 call disp%show(
"dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
174 call disp%show(
"[ndim, nsam, nprob]")
175 call disp%show( [ndim, nsam, nprob] )
176 call disp%show(
"sample = getPoisRand(getFilled(10., ndim, nsam))")
180 call disp%show(
"prob = getLinSpace(0., 1., nprob)")
184 call disp%show(
"quan2 = getQuan(neimean, prob, sample, dim)")
188 call disp%show(
"quan2 = getQuan(neinear, prob, sample, dim)")
192 call disp%show(
"quan2 = getQuan(neinext, prob, sample, dim)")
196 call disp%show(
"quan2 = getQuan(neiprev, prob, sample, dim)")
200 call disp%show(
"quan2 = getQuan(piwilin, prob, sample, dim)")
204 call disp%show(
"quan1 = getQuan(neimean, prob(nprob/2), sample, dim)")
208 call disp%show(
"quan1 = getQuan(neinear, prob(nprob/2), sample, dim)")
212 call disp%show(
"quan1 = getQuan(neinext, prob(nprob/2), sample, dim)")
216 call disp%show(
"quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)")
220 call disp%show(
"quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)")
229 real(TKG),
allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
230 integer(IK) :: nsam, nprob, dim
232 call disp%show(
"dim = 1; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
234 call disp%show(
"[ndim, nsam, nprob]")
235 call disp%show( [ndim, nsam, nprob] )
236 call disp%show(
"sample = getPoisRand(getFilled(10., nsam, ndim))")
240 call disp%show(
"prob = getLinSpace(0., 1., nprob)")
244 call disp%show(
"quan2 = getQuan(neimean, prob, sample, dim)")
248 call disp%show(
"quan2 = getQuan(neinear, prob, sample, dim)")
252 call disp%show(
"quan2 = getQuan(neinext, prob, sample, dim)")
256 call disp%show(
"quan2 = getQuan(neiprev, prob, sample, dim)")
260 call disp%show(
"quan2 = getQuan(piwilin, prob, sample, dim)")
264 call disp%show(
"quan1 = getQuan(neimean, prob(nprob/2), sample, dim)")
268 call disp%show(
"quan1 = getQuan(neinear, prob(nprob/2), sample, dim)")
272 call disp%show(
"quan1 = getQuan(neinext, prob(nprob/2), sample, dim)")
276 call disp%show(
"quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)")
280 call disp%show(
"quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)")
288 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
289 call disp%show(
"!2D frequency/reliability-weighted sample quantile.")
290 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
295 real(TKG),
allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
296 integer(IK) :: nsam, nprob, dim
298 call disp%show(
"dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
300 call disp%show(
"[ndim, nsam, nprob]")
301 call disp%show( [ndim, nsam, nprob] )
302 call disp%show(
"sample = getPoisRand(getFilled(10., ndim, nsam))")
306 call disp%show(
"iweight = getUnifRand(1, 9, nsam)")
310 call disp%show(
"prob = getLinSpace(0., 1., nprob)")
314 call disp%show(
"quan2 = getQuan(neimean, prob, sample, dim, iweight)")
318 call disp%show(
"quan2 = getQuan(neinear, prob, sample, dim, iweight)")
322 call disp%show(
"quan2 = getQuan(neinext, prob, sample, dim, iweight)")
326 call disp%show(
"quan2 = getQuan(neiprev, prob, sample, dim, iweight)")
330 call disp%show(
"quan2 = getQuan(piwilin, prob, sample, dim, iweight)")
334 call disp%show(
"quan1 = getQuan(neimean, prob(nprob/2), sample, dim, iweight)")
338 call disp%show(
"quan1 = getQuan(neinear, prob(nprob/2), sample, dim, iweight)")
342 call disp%show(
"quan1 = getQuan(neinext, prob(nprob/2), sample, dim, iweight)")
346 call disp%show(
"quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, iweight)")
350 call disp%show(
"quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, iweight)")
358 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
359 call disp%show(
"!2D frequency/reliability-weighted sample quantile.")
360 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
365 real(TKG),
allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
366 real(TKG),
allocatable :: rweight(:)
367 integer(IK) :: nsam, nprob, dim
369 call disp%show(
"dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
371 call disp%show(
"[ndim, nsam, nprob]")
372 call disp%show( [ndim, nsam, nprob] )
373 call disp%show(
"sample = getPoisRand(getFilled(10., ndim, nsam))")
377 call disp%show(
"rweight = getUnifRand(1, 9, nsam)")
381 call disp%show(
"prob = getLinSpace(0., 1., nprob)")
385 call disp%show(
"quan2 = getQuan(neimean, prob, sample, dim, rweight)")
389 call disp%show(
"quan2 = getQuan(neinear, prob, sample, dim, rweight)")
393 call disp%show(
"quan2 = getQuan(neinext, prob, sample, dim, rweight)")
397 call disp%show(
"quan2 = getQuan(neiprev, prob, sample, dim, rweight)")
401 call disp%show(
"quan2 = getQuan(piwilin, prob, sample, dim, rweight)")
405 call disp%show(
"quan1 = getQuan(neimean, prob(nprob/2), sample, dim, rweight)")
409 call disp%show(
"quan1 = getQuan(neinear, prob(nprob/2), sample, dim, rweight)")
413 call disp%show(
"quan1 = getQuan(neinext, prob(nprob/2), sample, dim, rweight)")
417 call disp%show(
"quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, rweight)")
421 call disp%show(
"quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, rweight)")
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
Generate count evenly spaced points over the interval [x1, x2] if x1 < x2, or [x2,...
Generate the natural logarithm of probability density function (PDF) of the univariate Normal distrib...
Generate and return a scalar or array of arbitrary rank of random values from the univariate Normal d...
Generate and return the natural logarithm of the Probability Mass Function (PMF) of the Poisson distr...
Generate and return a scalar (or array of arbitrary rank of) random value(s) from the Poisson distrib...
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Generate and return the iostat code resulting from writing the input table of rank 1 or 2 to the spec...
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 convenient allocation and filling of array...
This module contains procedures and generic interfaces for generating arrays with linear or logarithm...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for computing various statistical quantities related to t...
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 LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
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.
type(piwilin_type), parameter piwilin
type(neiprev_type), parameter neiprev
type(neinext_type), parameter neinext
type(neinear_type), parameter neinear
type(neimean_type), parameter neimean
Generate and return an object of type display_type.
7sample
= [
10,
7,
4,
3,
2,
1,
0]
8prob
= [
0., .
25, .
5, .
75, .
9,
1.]
11+0.00000000,
+0.500000000,
+2.50000000,
+5.50000000,
+8.50000000,
+10.0000000
14+0.00000000,
+1.00000000,
+2.00000000,
+4.00000000,
+7.00000000,
+10.0000000
17+0.00000000,
+1.00000000,
+3.00000000,
+7.00000000,
+10.0000000,
+10.0000000
20+0.00000000,
+0.00000000,
+2.00000000,
+4.00000000,
+7.00000000,
+10.0000000
23-1.00000000,
+0.749999881,
+2.50000000,
+4.75000000,
+7.89999962,
+10.0000000
24do iprob
= 1,
size(prob)
28-1.00000000,
+0.749999881,
+2.50000000,
+4.75000000,
+7.89999962,
+10.0000000
36sample
= [
10,
7,
4,
3,
2,
1,
0]
39+7,
+4,
+7,
+3,
+8,
+9,
+6
40prob
= [
0., .
25, .
5, .
75, .
9,
1.]
43+0.00000000,
+0.500000000,
+2.50000000,
+5.50000000,
+8.50000000,
+10.0000000
46+0.00000000,
+1.00000000,
+3.00000000,
+4.00000000,
+7.00000000,
+10.0000000
49+0.00000000,
+1.00000000,
+4.00000000,
+7.00000000,
+10.0000000,
+10.0000000
52+0.00000000,
+1.00000000,
+3.00000000,
+4.00000000,
+7.00000000,
+10.0000000
55-1.75000000,
+1.00000000,
+3.12500024,
+5.33333349,
+7.79999924,
+10.0000000
56do iprob
= 1,
size(prob)
60-1.75000000,
+1.00000000,
+3.12500024,
+5.33333349,
+7.79999924,
+10.0000000
63sample
= [
10,
7,
4,
3,
2,
1,
0]
66+0.398942292,
+0.398942292,
+0.398942292,
+0.398942292,
+0.398942292,
+0.398942292,
+0.398942292
67prob
= [
0., .
25, .
5, .
75, .
9,
1.]
70+0.00000000,
+0.500000000,
+2.50000000,
+5.50000000,
+8.50000000,
+10.0000000
73+0.00000000,
+1.00000000,
+2.00000000,
+4.00000000,
+7.00000000,
+10.0000000
76+0.00000000,
+1.00000000,
+3.00000000,
+7.00000000,
+10.0000000,
+10.0000000
79+0.00000000,
+0.00000000,
+2.00000000,
+4.00000000,
+7.00000000,
+10.0000000
82-1.00000000,
+0.749999881,
+2.50000000,
+4.75000000,
+7.89999962,
+10.0000000
83do iprob
= 1,
size(prob)
87-1.00000000,
+0.749999881,
+2.50000000,
+4.75000000,
+7.89999962,
+10.0000000
100+6.00000000,
+6.00000000,
+10.0000000,
+11.0000000,
+9.00000000,
+9.00000000,
+9.00000000,
+8.00000000,
+9.00000000,
+9.00000000
103+0.00000000,
+0.142857149,
+0.285714298,
+0.428571463,
+0.571428597,
+0.714285731,
+0.857142925,
+1.00000000
176+15.0000000,
+12.0000000,
+7.00000000
177+13.0000000,
+10.0000000,
+12.0000000
178+9.00000000,
+10.0000000,
+9.00000000
179+10.0000000,
+9.00000000,
+9.00000000
180+10.0000000,
+10.0000000,
+7.00000000
181+12.0000000,
+14.0000000,
+15.0000000
182+8.00000000,
+10.0000000,
+11.0000000
183+9.00000000,
+11.0000000,
+10.0000000
184+10.0000000,
+6.00000000,
+9.00000000
185+4.00000000,
+6.00000000,
+6.00000000
188+0.00000000,
+0.500000000,
+1.00000000
191+4.00000000,
+6.00000000,
+6.00000000
192+10.0000000,
+10.0000000,
+9.00000000
193+15.0000000,
+14.0000000,
+15.0000000
196+4.00000000,
+6.00000000,
+6.00000000
197+10.0000000,
+10.0000000,
+9.00000000
198+15.0000000,
+14.0000000,
+15.0000000
201+4.00000000,
+6.00000000,
+6.00000000
202+10.0000000,
+10.0000000,
+9.00000000
203+15.0000000,
+14.0000000,
+15.0000000
206+4.00000000,
+6.00000000,
+6.00000000
207+10.0000000,
+10.0000000,
+9.00000000
208+15.0000000,
+14.0000000,
+15.0000000
211+0.00000000,
+6.00000000,
+5.00000000
212+10.0000000,
+10.0000000,
+9.00000000
213+15.0000000,
+14.0000000,
+15.0000000
216+4.00000000,
+6.00000000,
+6.00000000
219+4.00000000,
+6.00000000,
+6.00000000
222+4.00000000,
+6.00000000,
+6.00000000
225+4.00000000,
+6.00000000,
+6.00000000
228+0.00000000,
+6.00000000,
+5.00000000
241+15.0000000,
+10.0000000,
+10.0000000,
+8.00000000,
+7.00000000
247+0.00000000,
+0.142857149,
+0.285714298,
+0.428571463,
+0.571428597,
+0.714285731,
+0.857142925,
+1.00000000
325+4.00000000,
+7.00000000,
+10.0000000,
+12.0000000,
+9.00000000,
+20.0000000,
+12.0000000
328+4.00000000,
+7.00000000,
+7.00000000,
+8.00000000,
+6.00000000,
+7.00000000,
+7.00000000
331+0.00000000,
+0.500000000,
+1.00000000