ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_statest::setProbKS Interface Reference

Return the probability and the corresponding Kolmogorov distribution quantile of the null-hypothesis that sample1 of size nsam1 originates from the same distribution as that of sample2 of size nsam2 or from the Uniform distribution or other distribution whose custom CDF is given.
More...

Detailed Description

Return the probability and the corresponding Kolmogorov distribution quantile of the null-hypothesis that sample1 of size nsam1 originates from the same distribution as that of sample2 of size nsam2 or from the Uniform distribution or other distribution whose custom CDF is given.

See pm_statest for the mathematical definition of the KS test.

Parameters
[out]probKS: The output scalar of,
  1. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
representing the probability of observing a KS test statistic as extreme as or more extreme than the observed value under the null hypothesis.
Small values of probKS cast doubt on the validity of the null hypothesis.
In other words, probKS represents the probability that the specified two samples or the sample and the specified CDF originate from the same distribution.
[out]quanKS: The output scalar of the same type and kind as the output probKS, containing the Kolmogorov distribution quantile corresponding to the input KS statistic statKS and sample size(s).
[in]statKS: The input scalar of the same type and kind as the output probKS, representing the KS test statistic for the null-hypothesis considered.
This quantity is the same as the Kolmogorov distance and can be readily obtained for any two samples or a sample against a distribution CDF via the generic interfaces getDisKolm or setDisKolm.
[in]weisum1: The input scalar of,
  1. type integer of default kind IK,
  2. type real of the same kind as that of the output probKS of type real,
representing either,
  1. the size of the first unweighted sample (if weisum1 is of type integer) or,
  2. the quantity sum(weight1) where weight1 is the vector of weights of the first sample in the KS test,
[in]weisum2: The input scalar of the same type and kind as the input weisum1, representing either,
  1. the size of the second unweighted sample (if weisum2 is of type integer) or,
  2. the quantity sum(weight2) where weight2 is the vector of weights of the second sample in the KS test,
(optional. It must be present if and only if the input argument weisum1 is also present and the KS test involves two samples.)
[in]wsqsum1: The input scalar of type real of the same kind as that of the input weisum1 of type real, representing the quantity sum(weight1**2) where weight1 is the vector of weights of the first sample in the KS test.
This quantity must be supplied if and only if the sample weights are reliability weights, which requires the weights (and hence, weisum1 and wsqsum1) to be of type real.
(optional. It must be present if and only if the input argument weisum1 is present and is of type real.)
[in]wsqsum2: The input scalar of type real of the same kind as that of the input weisum2 of type real, representing the quantity sum(weight2**2) where weight2 is the vector of weights of the first sample in the KS test.
This quantity must be supplied if and only if the sample weights are reliability weights, which requires the weights (and hence, weisum2 and wsqsum2) to be of type real.
(optional. It must be present if and only if the input argument weisum2 is present and is of type real.)


Possible calling interfaces

use pm_statest, only: setProbKS, ascending
! one-sample KS test.
call setProbKS(probKS, quanKS, statKS, weisum1) ! only unweighted or (integer) frequency-weighted sample.
call setProbKS(probKS, quanKS, statKS, weisum1, wsqsum1) ! only (real) reliability-weighted sample.
! two-sample KS test.
call setProbKS(probKS, quanKS, statKS, weisum1, weisum2) ! only unweighted or (integer) frequency-weighted samples.
call setProbKS(probKS, quanKS, statKS, weisum1, weisum2, wsqsum1) ! only if `sample1` is reliability weighted and `sample2` is unweighted or frequency-weighted.
call setProbKS(probKS, quanKS, statKS, weisum1, weisum2, wsqsum1, wsqsum2) ! only if both samples are reliability-real-weighted samples.
Return the probability and the corresponding Kolmogorov distribution quantile of the null-hypothesis ...
Definition: pm_statest.F90:680
This module contains classes and procedures for performing various statistical tests.
Definition: pm_statest.F90:77
Warning
The condition 0 < weisum1 must hold for the corresponding input arguments.
The condition 0 < weisum2 must hold for the corresponding input arguments.
The condition 0 < wsqsum1 must hold for the corresponding input arguments.
The condition 0 < wsqsum2 must hold for the corresponding input arguments.
The condition 0 <= statKS must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_distNorm, only: getNormRand
5 use pm_distUnif, only: getUnifRand
7 use pm_distanceKolm, only: ascending
10 use pm_arraySort, only: getSorted
11 use pm_arrayFill, only: getFilled
12 use pm_statest, only: setProbKS
13 use pm_io, only: display_type
14
15 implicit none
16
17 type(display_type) :: disp
18 integer(IK) :: nsam1, nsam2
19 integer(IK) :: itry, ntry = 10
20 disp = display_type(file = "main.out.F90")
21
22 call disp%skip()
23 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
24 call disp%show("! Compute the KS probability of sample originating from a Uniform distribution in range `[0, 1)`.")
25 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
26 call disp%skip()
27
28 block
29 use pm_kind, only: TKG => RKS ! all other real kinds are also supported.
30 integer(IK), allocatable :: iweight1(:)
31 real(TKG), allocatable :: rweight1(:)
32 real(TKG), allocatable :: sample1(:)
33 real(TKG) :: probKS, quanKS, statKS
34 do itry = 1, ntry
35 call disp%show("nsam1 = getUnifRand(1, 10)")
36 nsam1 = getUnifRand(1, 10)
37 call disp%show("sample1 = getUnifRand(0., 1., nsam1)")
38 sample1 = getUnifRand(0., 1., nsam1)
39 call disp%show("sample1")
40 call disp%show( sample1 )
41 call disp%show("statKS = getDisKolm(sample1) ! assuming unweighted samples.")
42 statKS = getDisKolm(sample1) ! assuming unweighted samples.
43 call disp%show("statKS")
44 call disp%show( statKS )
45 call disp%show("call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.")
46 call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
47 call disp%show("[probKS, quanKS]")
48 call disp%show( [probKS, quanKS] )
49 call disp%skip()
50 call disp%show("iweight1 = getUnifRand(1, 9, nsam1)")
51 iweight1 = getUnifRand(1, 9, nsam1)
52 call disp%show("iweight1")
53 call disp%show( iweight1 )
54 call disp%show("rweight1 = iweight1")
55 rweight1 = iweight1
56 call disp%show("statKS = getDisKolm(sample1, iweight1, sum(iweight1))")
57 statKS = getDisKolm(sample1, iweight1, sum(iweight1))
58 call disp%show("statKS")
59 call disp%show( statKS )
60 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(iweight1))")
61 call setProbKS(probKS, quanKS, statKS, sum(iweight1))
62 call disp%show("[probKS, quanKS]")
63 call disp%show( [probKS, quanKS] )
64 call disp%show("statKS = getDisKolm(sample1, rweight1, sum(rweight1))")
65 statKS = getDisKolm(sample1, rweight1, sum(rweight1))
66 call disp%show("statKS")
67 call disp%show( statKS )
68 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))")
69 call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
70 call disp%show("[probKS, quanKS]")
71 call disp%show( [probKS, quanKS] )
72 call disp%skip()
73 end do
74 end block
75
76 call disp%skip()
77 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
78 call disp%show("! Compute the KS probability of a sample against a Normal distribution.")
79 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
80 call disp%skip()
81
82 block
83 use pm_kind, only: TKG => RKS ! all other real kinds are also supported.
84 integer(IK), allocatable :: iweight1(:)
85 real(TKG), allocatable :: rweight1(:)
86 real(TKG), allocatable :: sample1(:)
87 real(TKG) :: probKS, quanKS, statKS
88 do itry = 1, ntry
89 call disp%show("nsam1 = getUnifRand(5, 10)")
90 nsam1 = getUnifRand(5, 10)
91 call disp%show("sample1 = getNormRand(mean = getFilled(0., nsam1))")
92 sample1 = getNormRand(mean = getFilled(0., nsam1))
93 call disp%show("sample1")
94 call disp%show( sample1 )
95 call disp%show("statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.")
96 statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
97 call disp%show("statKS")
98 call disp%show( statKS )
99 call disp%show("call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.")
100 call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
101 call disp%show("[probKS, quanKS]")
102 call disp%show( [probKS, quanKS] )
103 call disp%skip()
104 call disp%show("iweight1 = getUnifRand(1, 9, nsam1)")
105 iweight1 = getUnifRand(1, 9, nsam1)
106 call disp%show("iweight1")
107 call disp%show( iweight1 )
108 call disp%show("rweight1 = iweight1")
109 rweight1 = iweight1
110 call disp%show("statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)")
111 statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
112 call disp%show("statKS")
113 call disp%show( statKS )
114 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(iweight1))")
115 call setProbKS(probKS, quanKS, statKS, sum(iweight1))
116 call disp%show("[probKS, quanKS]")
117 call disp%show( [probKS, quanKS] )
118 call disp%show("statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)")
119 statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
120 call disp%show("statKS")
121 call disp%show( statKS )
122 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))")
123 call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
124 call disp%show("[probKS, quanKS]")
125 call disp%show( [probKS, quanKS] )
126 call disp%skip()
127 end do
128 end block
129
130 call disp%skip()
131 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
132 call disp%show("! Compute the two sample KS probability.")
133 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
134 call disp%skip()
135
136 block
137 use pm_kind, only: TKG => RKS ! all other real kinds are also supported.
138 integer(IK), allocatable :: iweight1(:), iweight2(:)
139 real(TKG), allocatable :: rweight1(:), rweight2(:)
140 real(TKG), allocatable :: sample1(:), sample2(:)
141 real(TKG) :: probKS, quanKS, statKS
142 do itry = 1, ntry
143 call disp%show("nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)")
144 nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
145 call disp%show("sample1 = getUnifRand(0., 1., nsam1)")
146 sample1 = getUnifRand(0., 1., nsam1)
147 call disp%show("sample1")
148 call disp%show( sample1 )
149 call disp%show("sample2 = getUnifRand(0., 1., nsam2)")
150 sample2 = getUnifRand(0., 1., nsam2)
151 call disp%show("sample2")
152 call disp%show( sample2 )
153 call disp%show("statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.")
154 statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
155 call disp%show("statKS")
156 call disp%show( statKS )
157 call disp%show("call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.")
158 call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
159 call disp%show("[probKS, quanKS]")
160 call disp%show( [probKS, quanKS] )
161 call disp%skip()
162 call disp%show("iweight1 = getUnifRand(1, 9, nsam1)")
163 iweight1 = getUnifRand(1, 9, nsam1)
164 call disp%show("iweight1")
165 call disp%show( iweight1 )
166 call disp%show("rweight1 = iweight1")
167 rweight1 = iweight1
168 call disp%show("statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)")
169 statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
170 call disp%show("statKS")
171 call disp%show( statKS )
172 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)")
173 call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
174 call disp%show("[probKS, quanKS]")
175 call disp%show( [probKS, quanKS] )
176 call disp%show("statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)")
177 statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
178 call disp%show("statKS")
179 call disp%show( statKS )
180 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))")
181 call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
182 call disp%show("[probKS, quanKS]")
183 call disp%show( [probKS, quanKS] )
184 call disp%skip()
185 call disp%show("iweight2 = getUnifRand(1, 9, nsam2)")
186 iweight2 = getUnifRand(1, 9, nsam2)
187 call disp%show("iweight2")
188 call disp%show( iweight2 )
189 call disp%show("rweight2 = iweight2")
190 rweight2 = iweight2
191 call disp%show("statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))")
192 statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
193 call disp%show("statKS")
194 call disp%show( statKS )
195 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))")
196 call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
197 call disp%show("[probKS, quanKS]")
198 call disp%show( [probKS, quanKS] )
199 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))")
200 call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
201 call disp%show("[probKS, quanKS]")
202 call disp%show( [probKS, quanKS] )
203 call disp%show("statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))")
204 statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
205 call disp%show("statKS")
206 call disp%show( statKS )
207 call disp%show("call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))")
208 call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
209 call disp%show("[probKS, quanKS]")
210 call disp%show( [probKS, quanKS] )
211 call disp%skip()
212 end do
213 end block
214
215contains
216
217 function getNormCDF_RKS(x) result(cdf)
218 use pm_distNorm, only: getNormCDF
219 use pm_kind, only: RKG => RKS
220 real(RKG), intent(in) :: x
221 real(RKG) :: cdf
222 cdf = getNormCDF(x)
223 end function
224
225 function getUnifCDF_RKS(x) result(cdf)
226 use pm_distUnif, only: getUnifCDF
227 use pm_kind, only: RKG => RKS
228 real(RKG), intent(in) :: x
229 real(RKG) :: cdf
230 cdf = getUnifCDF(x)
231 end function
232
233end program example
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 the univariate Normal distribution.
Generate and return a scalar or array of arbitrary rank of random values from the univariate Normal d...
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...
Generate and return the Kolmogorov distance of a sample1 of size nsam1 from another sample sample2 of...
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
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 computing various statistical quantities related to t...
This module contains classes and procedures for computing the Kolmogorov statistical distance.
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 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 RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

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! Compute the KS probability of sample originating from a Uniform distribution in range `[0, 1)`.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6nsam1 = getUnifRand(1, 10)
7sample1 = getUnifRand(0., 1., nsam1)
8sample1
9+0.249555469
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.750444531
13call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
14[probKS, quanKS]
15+0.361705840, +0.923046768
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+4
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.750444531
24call setProbKS(probKS, quanKS, statKS, sum(iweight1))
25[probKS, quanKS]
26+0.970500708E-2, +1.63221681
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.750444531
30call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
31[probKS, quanKS]
32+0.361705840, +0.923046768
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.841557503, +0.644738078, +0.872535110E-1, +0.593524575, +0.801190555, +0.363895416, +0.654039562
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.307810277
41call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
42[probKS, quanKS]
43+0.444119096, +0.864124179
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+6, +5, +3, +7, +8, +9, +8
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.332655013
52call setProbKS(probKS, quanKS, statKS, sum(iweight1))
53[probKS, quanKS]
54+0.501275063E-4, +2.30148983
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.332655013
58call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
59[probKS, quanKS]
60+0.393775344, +0.899244010
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.158734679, +0.778290927
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.341265321
69call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
70[probKS, quanKS]
71+0.922698200, +0.550118089
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+8, +2
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.641265333
80call setProbKS(probKS, quanKS, statKS, sum(iweight1))
81[probKS, quanKS]
82+0.234961510E-3, +2.12711716
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.641265333
86call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
87[probKS, quanKS]
88+0.375344157, +0.912768483
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.490797877, +0.610904098E-1, +0.178990126, +0.192978442
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.557021558
97call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
98[probKS, quanKS]
99+0.106184959, +1.21152186
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+3, +2, +2, +2
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.509202123
108call setProbKS(probKS, quanKS, statKS, sum(iweight1))
109[probKS, quanKS]
110+0.113993287E-1, +1.60738134
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.509202123
114call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
115[probKS, quanKS]
116+0.185917497, +1.08967745
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.760805011E-1, +0.738783360, +0.575072885, +0.429375708, +0.180011272, +0.869740188
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.153322071
125call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
126[probKS, quanKS]
127+0.997105777, +0.400844783
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+7, +1, +4, +4, +4, +2
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.319988728
136call setProbKS(probKS, quanKS, statKS, sum(iweight1))
137[probKS, quanKS]
138+0.167069435E-1, +1.54678333
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.319988728
142call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
143[probKS, quanKS]
144+0.624479890, +0.751596630
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.555587590, +0.185561538, +0.268361509, +0.799393177, +0.512172997, +0.694734454
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.200606823
153call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
154[probKS, quanKS]
155+0.946110487, +0.524465859
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+7, +9, +4, +9, +8, +9
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.229564309
164call setProbKS(probKS, quanKS, statKS, sum(iweight1))
165[probKS, quanKS]
166+0.128818154E-1, +1.58825183
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.229564309
170call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
171[probKS, quanKS]
172+0.882701755, +0.585643947
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.213127136E-1, +0.811957777, +0.474444687, +0.213783145, +0.462083697
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.325555325
181call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
182[probKS, quanKS]
183+0.571957409, +0.783045590
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+1, +6, +7, +9, +7
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.325555384
192call setProbKS(probKS, quanKS, statKS, sum(iweight1))
193[probKS, quanKS]
194+0.248998404E-2, +1.82874501
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.325555384
198call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
199[probKS, quanKS]
200+0.675803661, +0.721147537
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.250843346, +0.946807146, +0.533075809, +0.442408502, +0.467391491, +0.493385077, +0.194902897, +0.662707448, +0.126336217E-1, +0.849234760
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.166924179
209call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
210[probKS, quanKS]
211+0.919054627, +0.553697944
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+8, +4, +4, +7, +8, +2, +3, +9, +2, +3
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.197292507
220call setProbKS(probKS, quanKS, statKS, sum(iweight1))
221[probKS, quanKS]
222+0.350856781E-1, +1.42181289
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.197292507
226call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
227[probKS, quanKS]
228+0.881862402, +0.586319327
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.374048710, +0.764225721, +0.837047338, +0.413477421E-2, +0.868876219, +0.771119058, +0.726211667E-1
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.335654259
237call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
238[probKS, quanKS]
239+0.337042451, +0.942291379
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+9, +7, +8, +5, +7, +3, +7
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.307703972
248call setProbKS(probKS, quanKS, statKS, sum(iweight1))
249[probKS, quanKS]
250+0.231504440E-3, +2.12886477
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.307703972
254call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
255[probKS, quanKS]
256+0.489709258, +0.834148705
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.447513461, +0.247067630, +0.908288717, +0.374045551, +0.271606803, +0.462080121, +0.146921694, +0.882143974E-1, +0.740250707
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.315697670
265call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
266[probKS, quanKS]
267+0.273713827, +0.996552289
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+8, +5, +7, +6, +6, +5, +3, +8, +1
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.374654531
276call setProbKS(probKS, quanKS, statKS, sum(iweight1))
277[probKS, quanKS]
278+0.125169754E-5, +2.67342758
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.374654531
282call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
283[probKS, quanKS]
284+0.174543738, +1.10409713
285
286
287!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288! Compute the KS probability of a sample against a Normal distribution.
289!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290
291nsam1 = getUnifRand(5, 10)
292sample1 = getNormRand(mean = getFilled(0., nsam1))
293sample1
294+0.136388883, +0.605567694, +0.404625863, +0.756903112, +0.121487409, -1.22627771
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.381680787
298call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
299[probKS, quanKS]
300+0.272295237, +0.997865140
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+5, +4, +4, +6, +1, +7
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.289088219
309call setProbKS(probKS, quanKS, statKS, sum(iweight1))
310[probKS, quanKS]
311+0.171067119E-1, +1.54295683
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.289088219
315call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
316[probKS, quanKS]
317+0.708747506, +0.701493502
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322-1.04057145, +1.82433641, +2.53895116, -0.816127479, +0.863076866, -1.39803541, +0.696354628, +1.75025964, -1.15852964, +1.16431034
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.356896609
326call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
327[probKS, quanKS]
328+0.121229529, +1.18384838
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+4, +8, +7, +7, +1, +4, +7, +4, +1, +7
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.436896622
337call setProbKS(probKS, quanKS, statKS, sum(iweight1))
338[probKS, quanKS]
339+0.00000000, +3.14854980
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.436896622
343call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
344[probKS, quanKS]
345+0.646111965E-1, +1.31005371
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350+1.51843762, +0.729435623, +1.86606550, -0.757727101E-1, +0.320981413, -0.609201491, +0.147198111, -0.837240040, +0.360612899
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.247577742
354call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
355[probKS, quanKS]
356+0.574480355, +0.781520367
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+6, +9, +9, +9, +2, +1, +5, +9, +4
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.284614772
365call setProbKS(probKS, quanKS, statKS, sum(iweight1))
366[probKS, quanKS]
367+0.229477882E-3, +2.12989712
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.284614772
371call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
372[probKS, quanKS]
373+0.530221641, +0.808596313
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378+0.692703247, -0.669361472, -1.39046586, +0.490267962, -1.26310551, -0.811202288, -0.160265043, +1.52044880
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.248367548
382call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
383[probKS, quanKS]
384+0.640726447, +0.741952777
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+1, +7, +8, +6, +2, +8, +3, +2
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.424043238
393call setProbKS(probKS, quanKS, statKS, sum(iweight1))
394[probKS, quanKS]
395+0.178813934E-5, +2.63790798
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.424043238
399call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
400[probKS, quanKS]
401+0.175895274, +1.10234559
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406+0.780188739, -0.114481777, -1.20702732, +0.602363721E-1, -0.651725233, +0.177392483, -1.56050837, +0.787280440
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.215558887
410call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
411[probKS, quanKS]
412+0.801329732, +0.643942893
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+3, +9, +9, +8, +3, +1, +3, +6
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.237888455
421call setProbKS(probKS, quanKS, statKS, sum(iweight1))
422[probKS, quanKS]
423+0.140721798E-1, +1.57427776
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.237888455
427call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
428[probKS, quanKS]
429+0.828294694, +0.625866771
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434+1.65811586, -0.600132048, +1.07393289, +1.59756124, -0.420666814
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.458573610
438call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
439[probKS, quanKS]
440+0.175397635, +1.10298932
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+6, +5, +2, +8, +9
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.411596358
449call setProbKS(probKS, quanKS, statKS, sum(iweight1))
450[probKS, quanKS]
451+0.454783440E-4, +2.31206369
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.411596358
455call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
456[probKS, quanKS]
457+0.361312151, +0.923347116
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462-0.586329043, +0.984112263, +1.10989738, +0.124827862, +2.29397345, +0.238590166, +0.576355994, +0.894027948, -0.572956860, -0.729726970
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.249670088
466call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
467[probKS, quanKS]
468+0.499060452, +0.828171313
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+2, +6, +1, +6, +4, +9, +8, +9, +2, +3
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.409670115
477call setProbKS(probKS, quanKS, statKS, sum(iweight1))
478[probKS, quanKS]
479+0.596046448E-7, +2.95233846
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.409670115
483call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
484[probKS, quanKS]
485+0.117876351, +1.18976080
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490-0.442256600, +0.839802086, +0.884793103, +1.87960017, -0.398809940
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.399490327
494call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
495[probKS, quanKS]
496+0.314313829, +0.960878611
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+2, +4, +7, +9, +2
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.632823646
505call setProbKS(probKS, quanKS, statKS, sum(iweight1))
506[probKS, quanKS]
507+0.00000000, +3.19033813
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.632823646
511call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
512[probKS, quanKS]
513+0.563831329E-1, +1.33579755
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518+0.490279287, +0.226869941, +0.119143456, +0.767090559, +2.50107622, -1.58514166, +0.948038340, -1.78756726, -1.73981082
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.276866257
522call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
523[probKS, quanKS]
524+0.429648578, +0.873974442
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+5, +8, +8, +9, +8, +9, +4, +7, +3
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.255008310
533call setProbKS(probKS, quanKS, statKS, sum(iweight1))
534[probKS, quanKS]
535+0.544786453E-3, +2.02587104
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.255008310
539call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
540[probKS, quanKS]
541+0.591543794, +0.771249831
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546+1.36534190, -2.05721831, +0.706652641, +2.85573173, +0.250651240, -0.123919308, -0.197943762, +0.653735101, +0.397777975
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.310433447
550call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
551[probKS, quanKS]
552+0.292132497, +0.979934871
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+9, +9, +9, +2, +2, +9, +3, +4, +6
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.251733243
561call setProbKS(probKS, quanKS, statKS, sum(iweight1))
562[probKS, quanKS]
563+0.188153982E-2, +1.86665726
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.251733243
567call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
568[probKS, quanKS]
569+0.688537002, +0.713573337
570
571
572!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
573! Compute the two sample KS probability.
574!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
575
576nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
577sample1 = getUnifRand(0., 1., nsam1)
578sample1
579+0.725660682, +0.386335015, +0.353589177, +0.889835060, +0.550283134
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.852857888
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.800000012
586call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
587[probKS, quanKS]
588+0.362166107, +0.922695935
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+2, +3, +2, +8, +5
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.600000024
597call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
598[probKS, quanKS]
599+0.669028938, +0.725169897
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.600000024
603call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
604[probKS, quanKS]
605+0.744714260, +0.679696739
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+1
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.600000024
614call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
615[probKS, quanKS]
616+0.669028938, +0.725169897
617call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618[probKS, quanKS]
619+0.744714260, +0.679696739
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.600000024
623call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624[probKS, quanKS]
625+0.744714260, +0.679696739
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.994117320, +0.510379612, +0.981798708, +0.766516864, +0.243390024, +0.728488863
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.436963081, +0.424052179, +0.859232068, +0.966595292, +0.780610621, +0.529457927, +0.986880779, +0.849796593, +0.582064927, +0.174764156
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+0.233333349
637call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
638[probKS, quanKS]
639+0.968186021, +0.493102282
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+9, +4, +8, +7, +4, +9
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+0.314634204
648call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
649[probKS, quanKS]
650+0.337330997, +0.942061067
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+0.314634204
654call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
655[probKS, quanKS]
656+0.795125067, +0.647986054
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+4, +9, +6, +6, +4, +3, +9, +5, +7, +3
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+0.269163787
665call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
666[probKS, quanKS]
667+0.528317690E-1, +1.34791911
668call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669[probKS, quanKS]
670+0.797113299, +0.646694601
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+0.269163787
674call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675[probKS, quanKS]
676+0.930143535, +0.542505622
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.185329139, +0.661870956, +0.229286671
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.334512770, +0.547339618, +0.729911864, +0.550948262, +0.979734600, +0.762786150
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+0.666666687
688call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
689[probKS, quanKS]
690+0.198367178, +1.07466364
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+2, +9, +4
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+0.500000000
699call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
700[probKS, quanKS]
701+0.161435723, +1.12166584
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+0.500000000
705call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
706[probKS, quanKS]
707+0.643276572, +0.740440488
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+8, +8, +1, +2, +8, +3
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+0.400000036
716call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
717[probKS, quanKS]
718+0.591423512E-1, +1.32682514
719call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720[probKS, quanKS]
721+0.784895837, +0.654573083
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+0.400000036
725call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726[probKS, quanKS]
727+0.901241183, +0.570089817
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.220915675E-1, +0.256340861, +0.824155390
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.707827032, +0.735501528, +0.594927311
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.666666687
739call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
740[probKS, quanKS]
741+0.319724321, +0.956373096
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+8, +7, +6
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.714285731
750call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
751[probKS, quanKS]
752+0.711643100E-1, +1.29148483
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.714285731
756call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
757[probKS, quanKS]
758+0.247217238, +1.02194273
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+9, +6, +9
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.714285731
767call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
768[probKS, quanKS]
769+0.745058060E-5, +2.49964929
770call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771[probKS, quanKS]
772+0.704075098E-1, +1.29355311
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.714285731
776call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777[probKS, quanKS]
778+0.253495038, +1.01575279
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.471772552, +0.533313811, +0.979318619, +0.232793093
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.412247002, +0.340840816, +0.661848009, +0.631533146, +0.472228229, +0.638137341, +0.822668970
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+0.321428537
790call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
791[probKS, quanKS]
792+0.897244513, +0.573555171
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+8, +4, +6, +3
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+0.285714269
801call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
802[probKS, quanKS]
803+0.706809402, +0.702655911
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+0.285714269
807call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
808[probKS, quanKS]
809+0.968598187, +0.492401004
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+4, +1, +3, +9, +6, +9, +9
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+0.445993066
818call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
819[probKS, quanKS]
820+0.507402420E-2, +1.72869456
821call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822[probKS, quanKS]
823+0.414376736, +0.884575248
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+0.445993066
827call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828[probKS, quanKS]
829+0.642189682, +0.741084993
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.104163170, +0.402716398E-1, +0.769958138, +0.656907082, +0.405296147, +0.925457478E-2, +0.585104287
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.956998885, +0.592527926, +0.185544491, +0.867063165, +0.385210156, +0.383065343, +0.414294243
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.428571463
841call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
842[probKS, quanKS]
843+0.423218310, +0.878411233
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+6, +4, +9, +5, +9, +6, +3
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.380952418
852call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
853[probKS, quanKS]
854+0.274354696, +0.995960891
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.380952418
858call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
859[probKS, quanKS]
860+0.610514164, +0.759908319
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+3, +8, +8, +8, +9, +4, +8
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.380952418
869call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
870[probKS, quanKS]
871+0.201338530E-2, +1.85756409
872call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873[probKS, quanKS]
874+0.319010973, +0.956964016
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.380952418
878call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879[probKS, quanKS]
880+0.635967255, +0.744775832
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.745877802, +0.229861557, +0.281458616, +0.608282864, +0.171462417, +0.545058608, +0.473988771, +0.401905775, +0.952116907
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.763356626, +0.928640425, +0.496933281, +0.160847783, +0.144419253, +0.689561665, +0.962090194, +0.854294658
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+0.402777791
892call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
893[probKS, quanKS]
894+0.394428611, +0.898771822
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+9, +4, +2, +6, +7, +6, +8, +8, +6
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+0.392857194
903call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
904[probKS, quanKS]
905+0.175483108, +1.10287869
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+0.392857194
909call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
910[probKS, quanKS]
911+0.454138935, +0.857405424
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+4, +4, +7, +3, +8, +9, +6, +1
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+0.303571403
920call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
921[probKS, quanKS]
922+0.184753537E-1, +1.53043497
923call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924[probKS, quanKS]
925+0.478657722, +0.841282308
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+0.303571403
929call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930[probKS, quanKS]
931+0.821491599, +0.630513668
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.652330875, +0.508425772, +0.105229914, +0.137712717, +0.406633317, +0.340529203, +0.374366641
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.671436191E-1, +0.237999558, +0.600627184, +0.991357327, +0.594674885, +0.767674208
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+0.523809552
943call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
944[probKS, quanKS]
945+0.232980132, +1.03642654
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+1, +6, +5, +6, +8, +6, +2
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+0.637254834
954call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
955[probKS, quanKS]
956+0.167223215E-1, +1.54663455
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+0.637254834
960call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
961[probKS, quanKS]
962+0.107979298, +1.20805740
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+1, +1, +7, +9, +8, +4
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+0.903921545
971call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
972[probKS, quanKS]
973+0.00000000, +3.74199462
974call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975[probKS, quanKS]
976+0.218808651E-3, +2.13545394
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+0.903921545
980call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981[probKS, quanKS]
982+0.132895112E-1, +1.58333957
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.176995516, +0.545700431, +0.310479403
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.327256083, +0.532386601, +0.938651979, +0.545160174E-1
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+0.416666687
994call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
995[probKS, quanKS]
996+0.821437240, +0.630550563
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+5, +1, +9
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+0.683333397
1005call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1006[probKS, quanKS]
1007+0.555401444E-1, +1.33861399
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+0.683333397
1011call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012[probKS, quanKS]
1013+0.329634130, +0.948253751
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+6, +5, +1, +2
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+0.790476263
1022call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1023[probKS, quanKS]
1024+0.770688057E-4, +2.25432634
1025call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026[probKS, quanKS]
1027+0.979957581E-1, +1.22797811
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+0.790476263
1031call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032[probKS, quanKS]
1033+0.219936013, +1.05029273
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.780904531
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.577523351, +0.281509161, +0.718317807, +0.916631460, +0.534032226, +0.780738473, +0.138916552, +0.857305825
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+0.750000000
1045call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
1046[probKS, quanKS]
1047+0.414325297, +0.884611249
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+2
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+0.750000000
1056call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1057[probKS, quanKS]
1058+0.174691439, +1.10390520
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+0.750000000
1062call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063[probKS, quanKS]
1064+0.414325297, +0.884611249
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+4, +6, +2, +6, +5, +3, +3, +9
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+0.605263114
1073call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1074[probKS, quanKS]
1075+0.321106136, +0.955230653
1076call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077[probKS, quanKS]
1078+0.648179233, +0.737533748
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+0.605263114
1082call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083[probKS, quanKS]
1084+0.696993232, +0.708529413
1085
1086
Test:
test_pm_statest
Internal naming convention:
The following illustrates the internal naming convention used for the procedures within this generic interface.
setProbKS_WIX_D0_RK5()
||| || |||
||| || |||
||| || |||
||| || |The Kind of the output.
||| The rank of the input arguments.
The sample presence and weight types: X => missing, WDD => default(unweighted) / default(unweighted), WID => integer-weighted, default, WRD => real-weighted, default., WII => integer-weighted, integer-weighted, WRR => real-weighted, real-weighted.


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, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.

Definition at line 680 of file pm_statest.F90.


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