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+8,
+6,
+8,
+9,
+1,
+6,
+5
40prob
= [
0., .
25, .
5, .
75, .
9,
1.]
43+0.00000000,
+0.500000000,
+2.50000000,
+5.50000000,
+8.50000000,
+10.0000000
46+0.00000000,
+0.00000000,
+2.00000000,
+4.00000000,
+7.00000000,
+10.0000000
49+0.00000000,
+1.00000000,
+2.00000000,
+7.00000000,
+10.0000000,
+10.0000000
52+0.00000000,
+0.00000000,
+1.00000000,
+4.00000000,
+7.00000000,
+10.0000000
55-1.33333325,
+0.458333313,
+1.93749988,
+4.12500000,
+7.41999960,
+10.0000000
56do iprob
= 1,
size(prob)
60-1.33333325,
+0.458333313,
+1.93749988,
+4.12500000,
+7.41999960,
+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+12.0000000,
+10.0000000,
+11.0000000,
+10.0000000,
+12.0000000
103+0.00000000,
+0.500000000,
+1.00000000
151+15.0000000,
+9.00000000
152+12.0000000,
+13.0000000
153+12.0000000,
+11.0000000
154+11.0000000,
+10.0000000
155+10.0000000,
+11.0000000
156+11.0000000,
+8.00000000
157+13.0000000,
+10.0000000
158+8.00000000,
+7.00000000
159+10.0000000,
+9.00000000
162+0.00000000,
+0.200000003,
+0.400000006,
+0.600000024,
+0.800000012,
+1.00000000
165+8.00000000,
+7.00000000
166+9.00000000,
+7.50000000
167+10.5000000,
+9.00000000
168+11.5000000,
+10.0000000
169+12.5000000,
+11.0000000
170+15.0000000,
+13.0000000
173+8.00000000,
+7.00000000
174+10.0000000,
+8.00000000
175+11.0000000,
+9.00000000
176+11.0000000,
+10.0000000
177+12.0000000,
+11.0000000
178+15.0000000,
+13.0000000
181+8.00000000,
+7.00000000
182+10.0000000,
+8.00000000
183+11.0000000,
+9.00000000
184+12.0000000,
+10.0000000
185+13.0000000,
+11.0000000
186+15.0000000,
+13.0000000
189+8.00000000,
+7.00000000
190+8.00000000,
+7.00000000
191+10.0000000,
+9.00000000
192+11.0000000,
+10.0000000
193+12.0000000,
+11.0000000
194+15.0000000,
+13.0000000
197+6.00000000,
+6.00000000
198+9.60000038,
+7.80000019
199+10.6000004,
+9.00000000
200+11.3999996,
+10.0000000
201+12.2000008,
+11.0000000
202+15.0000000,
+13.0000000
205+10.5000000,
+9.00000000
208+11.0000000,
+9.00000000
211+11.0000000,
+9.00000000
214+10.0000000,
+9.00000000
217+10.6000004,
+9.00000000
230+7.00000000,
+7.00000000,
+9.00000000,
+11.0000000,
+8.00000000,
+5.00000000,
+12.0000000
233+9,
+4,
+6,
+1,
+3,
+6,
+9
236+0.00000000,
+0.200000003,
+0.400000006,
+0.600000024,
+0.800000012,
+1.00000000
304+6.00000000,
+11.0000000,
+11.0000000,
+11.0000000,
+12.0000000,
+7.00000000,
+5.00000000,
+10.0000000
305+12.0000000,
+8.00000000,
+9.00000000,
+8.00000000,
+7.00000000,
+7.00000000,
+6.00000000,
+14.0000000
306+19.0000000,
+10.0000000,
+14.0000000,
+9.00000000,
+7.00000000,
+16.0000000,
+12.0000000,
+6.00000000
309+2.00000000,
+4.00000000,
+1.00000000,
+9.00000000,
+1.00000000,
+1.00000000,
+7.00000000,
+7.00000000
312+0.00000000,
+0.500000000,
+1.00000000
315+5.00000000,
+6.00000000,
+6.00000000
316+10.0000000,
+8.00000000,
+10.0000000
317+12.0000000,
+14.0000000,
+19.0000000
320+5.00000000,
+6.00000000,
+6.00000000
321+10.0000000,
+8.00000000,
+10.0000000
322+12.0000000,
+14.0000000,
+19.0000000
325+5.00000000,
+6.00000000,
+6.00000000
326+10.0000000,
+8.00000000,
+10.0000000
327+12.0000000,
+14.0000000,
+19.0000000
330+5.00000000,
+6.00000000,
+6.00000000
331+10.0000000,
+8.00000000,
+10.0000000
332+12.0000000,
+14.0000000,
+19.0000000
335+4.50000000,
+5.50000000,
+5.50000000
336+10.0000000,
+8.00000000,
+10.0000000
337+12.0000000,
+14.0000000,
+19.0000000
340+5.00000000,
+6.00000000,
+6.00000000
343+5.00000000,
+6.00000000,
+6.00000000
346+5.00000000,
+6.00000000,
+6.00000000
349+5.00000000,
+6.00000000,
+6.00000000
352+4.50000000,
+5.50000000,
+5.50000000