15 type(display_type) :: disp
16 integer(IK) :: nsam1, nsam2
17 integer(IK) :: itry, ntry
= 10
21 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
22 call disp%show(
"! Compute the Kolmogorov distance of one sample w.r.t. Uniform or arbitrary distribution.")
23 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
28 integer(IK),
allocatable :: iweight1(:)
29 real(TKG),
allocatable :: rweight1(:)
30 real(TKG),
allocatable :: sample1(:)
33 call disp%show(
"nsam1 = getUnifRand(0, 10)")
35 call disp%show(
"sample1 = getUnifRand(0., 1., nsam1)")
39 call disp%show(
"disKolm = getDisKolm(sample1) ! assuming unweighted samples.")
43 call disp%show(
"disKolm = getDisKolm(sample1, getUnifCDF_RKS) ! assuming unweighted samples.")
47 call disp%show(
"disKolm = getDisKolm(getSorted(sample1), ascending) ! assuming unweighted samples.")
51 call disp%show(
"disKolm = getDisKolm(getSorted(sample1), getUnifCDF_RKS, ascending) ! assuming unweighted samples.")
56 call disp%show(
"iweight1 = getUnifRand(0, 9, nsam1)")
60 call disp%show(
"rweight1 = iweight1")
62 call disp%show(
"disKolm = getDisKolm(getVerbose(sample1, iweight1, sum(iweight1)))")
66 call disp%show(
"disKolm = getDisKolm(getVerbose(sample1, iweight1, sum(iweight1)), getUnifCDF_RKS)")
70 call disp%show(
"disKolm = getDisKolm(sample1, iweight1, sum(iweight1))")
71 disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
74 call disp%show(
"disKolm = getDisKolm(sample1, iweight1, sum(iweight1), getUnifCDF_RKS)")
75 disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
78 call disp%show(
"disKolm = getDisKolm(sample1, rweight1, sum(rweight1))")
79 disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
82 call disp%show(
"disKolm = getDisKolm(sample1, rweight1, sum(rweight1), getUnifCDF_RKS)")
83 disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
91 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
92 call disp%show(
"! Compute the Kolmogorov distance of two samples.")
93 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
98 integer(IK),
allocatable :: iweight1(:), iweight2(:)
99 real(TKG),
allocatable :: rweight1(:), rweight2(:)
100 real(TKG),
allocatable :: sample1(:), sample2(:)
103 call disp%show(
"nsam1 = getUnifRand(0, 10); nsam2 = getUnifRand(0, 10)")
105 call disp%show(
"sample1 = getUnifRand(0., 1., nsam1)")
109 call disp%show(
"sample2 = getUnifRand(0., 1., nsam2)")
113 call disp%show(
"disKolm = getDisKolm(sample1, sample2) ! assuming unweighted samples.")
117 call disp%show(
"disKolm = getDisKolm(getSorted(sample1), getSorted(sample2), ascending) ! assuming unweighted samples.")
122 call disp%show(
"iweight1 = getUnifRand(0, 9, nsam1)")
126 call disp%show(
"rweight1 = iweight1")
128 call disp%show(
"disKolm = getDisKolm(getVerbose(sample1, iweight1, sum(iweight1)), sample2)")
132 call disp%show(
"disKolm = getDisKolm(sample1, iweight1, sum(iweight1), sample2)")
133 disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
136 call disp%show(
"disKolm = getDisKolm(sample1, rweight1, sum(rweight1), sample2)")
137 disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
141 call disp%show(
"iweight2 = getUnifRand(0, 9, nsam2)")
145 call disp%show(
"rweight2 = iweight2")
147 call disp%show(
"disKolm = getDisKolm(getVerbose(sample1, iweight1, sum(iweight1)), getVerbose(sample2, iweight2, sum(iweight2)))")
151 call disp%show(
"disKolm = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))")
152 disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
155 call disp%show(
"disKolm = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))")
156 disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
165 function getUnifCDF_RKS(x)
result(cdf)
168 real(RKG),
intent(in) :: x
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate and return the sorted elements of the input scalar string or contiguous vector in ascending ...
Generate an equally-weighted (verbose or flattened) array of the input weighted array of rank 1 or 2.
Generate and return the Cumulative Distribution Function (CDF) of a univariate Standard Uniform distr...
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
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 resizing allocatable arrays of various typ...
This module contains procedures and generic interfaces for various sorting tasks.
This module contains procedures and generic interfaces for flattening (duplicating the elements of) a...
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 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.
Generate and return an object of type display_type.
6nsam1
= getUnifRand(
0,
10)
7sample1
= getUnifRand(
0.,
1., nsam1)
9+0.624347091,
+0.795805514,
+0.342734814,
+0.566092849
23iweight1
= getUnifRand(
0,
9, nsam1)
33disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
36disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
39disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
42disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
46nsam1
= getUnifRand(
0,
10)
47sample1
= getUnifRand(
0.,
1., nsam1)
63iweight1
= getUnifRand(
0,
9, nsam1)
73disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
76disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
79disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
82disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
86nsam1
= getUnifRand(
0,
10)
87sample1
= getUnifRand(
0.,
1., nsam1)
89+0.916549146,
+0.378229141,
+0.790342271,
+0.464243114,
+0.877207756,
+0.100165427,
+0.704494059
103iweight1
= getUnifRand(
0,
9, nsam1)
105+3,
+1,
+8,
+4,
+5,
+9,
+6
113disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
116disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
119disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
122disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
126nsam1
= getUnifRand(
0,
10)
127sample1
= getUnifRand(
0.,
1., nsam1)
129+0.717904568,
+0.626077592,
+0.167240977,
+0.691282153E-1
143iweight1
= getUnifRand(
0,
9, nsam1)
153disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
156disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
159disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
162disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
166nsam1
= getUnifRand(
0,
10)
167sample1
= getUnifRand(
0.,
1., nsam1)
169+0.304361880,
+0.257395744
183iweight1
= getUnifRand(
0,
9, nsam1)
193disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
196disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
199disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
202disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
206nsam1
= getUnifRand(
0,
10)
207sample1
= getUnifRand(
0.,
1., nsam1)
223iweight1
= getUnifRand(
0,
9, nsam1)
233disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
236disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
239disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
242disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
246nsam1
= getUnifRand(
0,
10)
247sample1
= getUnifRand(
0.,
1., nsam1)
249+0.643387318,
+0.346974015
263iweight1
= getUnifRand(
0,
9, nsam1)
273disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
276disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
279disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
282disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
286nsam1
= getUnifRand(
0,
10)
287sample1
= getUnifRand(
0.,
1., nsam1)
289+0.493739724,
+0.898945212
303iweight1
= getUnifRand(
0,
9, nsam1)
313disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
316disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
319disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
322disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
326nsam1
= getUnifRand(
0,
10)
327sample1
= getUnifRand(
0.,
1., nsam1)
329+0.359618664E-1,
+0.974963903E-1,
+0.353885412,
+0.119003057E-1,
+0.238083780,
+0.565811992E-1,
+0.932155371,
+0.491428614
343iweight1
= getUnifRand(
0,
9, nsam1)
345+5,
+3,
+1,
+5,
+4,
+5,
+6,
+4
353disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
356disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
359disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
362disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
366nsam1
= getUnifRand(
0,
10)
367sample1
= getUnifRand(
0.,
1., nsam1)
369+0.102512360,
+0.803096294E-1,
+0.303076267,
+0.474512339,
+0.658946455,
+0.270897388,
+0.130082250,
+0.978469849E-1,
+0.922258615
383iweight1
= getUnifRand(
0,
9, nsam1)
385+2,
+6,
+6,
+4,
+8,
+7,
+9,
+6,
+6
393disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1))
396disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), getUnifCDF_RKS)
399disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1))
402disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), getUnifCDF_RKS)
411nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
412sample1
= getUnifRand(
0.,
1., nsam1)
415sample2
= getUnifRand(
0.,
1., nsam2)
417+0.577589452,
+0.553508461,
+0.864089966,
+0.447598457,
+0.258683026,
+0.793058276E-1,
+0.797105193
425iweight1
= getUnifRand(
0,
9, nsam1)
432disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
435disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
439iweight2
= getUnifRand(
0,
9, nsam2)
441+3,
+7,
+3,
+5,
+9,
+3,
+0
446disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
449disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
453nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
454sample1
= getUnifRand(
0.,
1., nsam1)
456+0.798392832,
+0.349904537,
+0.198252141,
+0.890031397
457sample2
= getUnifRand(
0.,
1., nsam2)
459+0.562371075,
+0.927726924,
+0.438646078,
+0.574812174,
+0.558548093,
+0.513146520,
+0.601736009
467iweight1
= getUnifRand(
0,
9, nsam1)
474disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
477disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
481iweight2
= getUnifRand(
0,
9, nsam2)
483+8,
+2,
+7,
+7,
+1,
+4,
+3
488disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
491disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
495nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
496sample1
= getUnifRand(
0.,
1., nsam1)
498+0.777364314,
+0.837822378,
+0.567450523
499sample2
= getUnifRand(
0.,
1., nsam2)
501+0.996041298E-1,
+0.286780834,
+0.918943882,
+0.483206093
509iweight1
= getUnifRand(
0,
9, nsam1)
516disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
519disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
523iweight2
= getUnifRand(
0,
9, nsam2)
530disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
533disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
537nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
538sample1
= getUnifRand(
0.,
1., nsam1)
540+0.562488973,
+0.673627913,
+0.534842193
541sample2
= getUnifRand(
0.,
1., nsam2)
543+0.633622766,
+0.606355786,
+0.888287187,
+0.982027233,
+0.418524325,
+0.571220756,
+0.102164745E-1,
+0.848675430,
+0.457589626E-1
551iweight1
= getUnifRand(
0,
9, nsam1)
558disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
561disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
565iweight2
= getUnifRand(
0,
9, nsam2)
567+2,
+6,
+6,
+0,
+2,
+1,
+3,
+9,
+9
572disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
575disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
579nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
580sample1
= getUnifRand(
0.,
1., nsam1)
582+0.446284115,
+0.666748881E-1,
+0.487574935
583sample2
= getUnifRand(
0.,
1., nsam2)
585+0.348782122,
+0.524147332,
+0.638986468,
+0.141339183,
+0.233903110,
+0.948014975
593iweight1
= getUnifRand(
0,
9, nsam1)
600disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
603disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
607iweight2
= getUnifRand(
0,
9, nsam2)
609+3,
+9,
+2,
+5,
+9,
+5
614disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
617disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
621nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
622sample1
= getUnifRand(
0.,
1., nsam1)
624+0.770448387,
+0.688933611
625sample2
= getUnifRand(
0.,
1., nsam2)
635iweight1
= getUnifRand(
0,
9, nsam1)
642disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
645disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
649iweight2
= getUnifRand(
0,
9, nsam2)
656disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
659disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
663nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
664sample1
= getUnifRand(
0.,
1., nsam1)
667sample2
= getUnifRand(
0.,
1., nsam2)
669+0.523479581,
+0.799529672,
+0.776637852,
+0.341538191E-1,
+0.847989678,
+0.867558002,
+0.299357653
677iweight1
= getUnifRand(
0,
9, nsam1)
684disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
687disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
691iweight2
= getUnifRand(
0,
9, nsam2)
693+1,
+5,
+7,
+6,
+0,
+8,
+4
698disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
701disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
705nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
706sample1
= getUnifRand(
0.,
1., nsam1)
708+0.594481230E-1,
+0.544176400,
+0.619935989,
+0.396251678E-2
709sample2
= getUnifRand(
0.,
1., nsam2)
711+0.751352906,
+0.904578567,
+0.601069629,
+0.371777654,
+0.953513801
719iweight1
= getUnifRand(
0,
9, nsam1)
726disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
729disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
733iweight2
= getUnifRand(
0,
9, nsam2)
740disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
743disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
747nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
748sample1
= getUnifRand(
0.,
1., nsam1)
751sample2
= getUnifRand(
0.,
1., nsam2)
753+0.923354685,
+0.228304625,
+0.631594241
761iweight1
= getUnifRand(
0,
9, nsam1)
768disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
771disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
775iweight2
= getUnifRand(
0,
9, nsam2)
782disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
785disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))
789nsam1
= getUnifRand(
0,
10); nsam2
= getUnifRand(
0,
10)
790sample1
= getUnifRand(
0.,
1., nsam1)
792+0.926965475E-2,
+0.789496899,
+0.149928868,
+0.162669420,
+0.427896440,
+0.313291550E-1
793sample2
= getUnifRand(
0.,
1., nsam2)
795+0.765802503,
+0.942707300,
+0.205031991,
+0.520078063,
+0.562458992,
+0.583359480,
+0.432790816,
+0.614580572,
+0.954010010,
+0.897577763
803iweight1
= getUnifRand(
0,
9, nsam1)
805+6,
+4,
+6,
+6,
+0,
+0
810disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2)
813disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2)
817iweight2
= getUnifRand(
0,
9, nsam2)
819+4,
+3,
+4,
+2,
+9,
+8,
+0,
+0,
+4,
+9
824disKolm
= getDisKolm(sample1, iweight1,
sum(iweight1), sample2, iweight2,
sum(iweight2))
827disKolm
= getDisKolm(sample1, rweight1,
sum(rweight1), sample2, rweight2,
sum(rweight2))