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

Generate and return the probability 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

Generate and return the probability 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
[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.)
Returns
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.


Possible calling interfaces

use pm_statest, only: getProbKS, ascending
! one-sample KS test.
probKS = getProbKS(statKS, weisum1) ! only unweighted or (integer) frequency-weighted sample.
probKS = getProbKS(statKS, weisum1, wsqsum1) ! only (real) reliability-weighted sample.
! two-sample KS test.
probKS = getProbKS(statKS, weisum1, weisum2) ! only unweighted or (integer) frequency-weighted samples.
probKS = getProbKS(statKS, weisum1, weisum2, wsqsum1) ! only if `sample1` is reliability weighted and `sample2` is unweighted or frequency-weighted.
probKS = getProbKS(statKS, weisum1, weisum2, wsqsum1, wsqsum2) ! only if both samples are reliability-real-weighted samples.
!
Generate and return the probability of the null-hypothesis that sample1 of size nsam1 originates from...
Definition: pm_statest.F90:196
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: getProbKS
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) :: statKS, probKS
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("probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.")
46 probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
47 call disp%show("probKS")
48 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(iweight1))")
61 probKS = getProbKS(statKS, sum(iweight1))
62 call disp%show("probKS")
63 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))")
69 probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
70 call disp%show("probKS")
71 call disp%show( probKS )
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) :: statKS, probKS
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("probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.")
100 probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
101 call disp%show("probKS")
102 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(iweight1))")
115 probKS = getProbKS(statKS, sum(iweight1))
116 call disp%show("probKS")
117 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))")
123 probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
124 call disp%show("probKS")
125 call disp%show( probKS )
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) :: statKS, probKS
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("probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.")
158 probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
159 call disp%show("probKS")
160 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(iweight1), nsam2)")
173 probKS = getProbKS(statKS, sum(iweight1), nsam2)
174 call disp%show("probKS")
175 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))")
181 probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
182 call disp%show("probKS")
183 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))")
196 probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
197 call disp%show("probKS")
198 call disp%show( probKS )
199 call disp%show("probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))")
200 probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
201 call disp%show("probKS")
202 call disp%show( probKS )
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("probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))")
208 probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
209 call disp%show("probKS")
210 call disp%show( probKS )
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.977421224
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.977421224
13probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
14probKS
15+0.111055136
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+8
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.977421224
24probKS = getProbKS(statKS, sum(iweight1))
25probKS
26+0.596046448E-7
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.977421224
30probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
31probKS
32+0.111055136
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.282225609E-1, +0.248199701E-1, +0.694696665, +0.298018217, +0.203974426
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.501981795
41probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
42probKS
43+0.108324051
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+6, +9, +3, +3, +5
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.586597264
52probKS = getProbKS(statKS, sum(iweight1))
53probKS
54+0.00000000
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.586597264
58probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
59probKS
60+0.654728413E-1
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.390291989, +0.272128820, +0.178313613, +0.866233766
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.359708011
69probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
70probKS
71+0.573083043
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+9, +4, +3, +4
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.409708083
80probKS = getProbKS(statKS, sum(iweight1))
81probKS
82+0.156092644E-2
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.409708083
86probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
87probKS
88+0.518472791
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.418912232, +0.779013634E-1, +0.603253841E-1
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.588765323
97probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
98probKS
99+0.157037556
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+8, +3, +6
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.581087768
108probKS = getProbKS(statKS, sum(iweight1))
109probKS
110+0.900030136E-5
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.581087768
114probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
115probKS
116+0.215478837
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.280966341, +0.363789022, +0.552643776
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.447356224
125probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
126probKS
127+0.454841495
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+7, +4, +8
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.447356224
136probKS = getProbKS(statKS, sum(iweight1))
137probKS
138+0.595033169E-3
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.447356224
142probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
143probKS
144+0.493902564
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.879443884E-1, +0.506753325
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.493246675
153probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
154probKS
155+0.552116394
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+3, +7
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.493246675
164probKS = getProbKS(statKS, sum(iweight1))
165probKS
166+0.945985317E-2
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.493246675
170probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
171probKS
172+0.630239725
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.748675108, +0.990334749, +0.304757237, +0.194653034, +0.750824153
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.348675102
181probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
182probKS
183+0.482714593
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+4, +7, +8, +1, +8
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.427246511
192probKS = getProbKS(statKS, sum(iweight1))
193probKS
194+0.419020653E-4
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.427246511
198probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
199probKS
200+0.348123431
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.183262825E-1, +0.413981676, +0.889078021, +0.992694378
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.389078021
209probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
210probKS
211+0.471042097
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+2, +4, +7, +1
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.460506558
220probKS = getProbKS(statKS, sum(iweight1))
221probKS
222+0.325244665E-2
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.460506558
226probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
227probKS
228+0.456087172
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.871058881
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.871058881
237probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
238probKS
239+0.201154888
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+1
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.871058881
248probKS = getProbKS(statKS, sum(iweight1))
249probKS
250+0.201154888
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.871058881
254probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
255probKS
256+0.201154888
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.927959740, +0.681383073, +0.525358558, +0.667170703, +0.186861336, +0.738574564
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.358691871
265probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
266probKS
267+0.342742920
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+6, +5, +6, +6, +6, +5
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.348887980
276probKS = getProbKS(statKS, sum(iweight1))
277probKS
278+0.341236591E-3
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.348887980
282probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
283probKS
284+0.380094409
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.611315429, +0.744792461, +0.186102405, +1.00170028, -0.274076432, +0.500599146, +0.192758575, -0.782971442
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.323817790
298probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
299probKS
300+0.306657851
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+3, +7, +4, +1, +8, +3, +2, +2
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.325346291
309probKS = getProbKS(statKS, sum(iweight1))
310probKS
311+0.251150131E-2
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.325346291
315probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
316probKS
317+0.487765551
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322-0.415161341, -1.20703471, -1.36520422, +0.316389531, +3.42308068, +0.348236829, +2.69583273, +1.60451663
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.320699871
326probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
327probKS
328+0.317724288
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+9, +6, +6, +2, +5, +5, +8, +3
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.309336185
337probKS = getProbKS(statKS, sum(iweight1))
338probKS
339+0.310361385E-3
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.309336185
343probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
344probKS
345+0.445102572
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350+0.486906022E-1, -0.799988568, +0.598107427E-1, +0.771048188, +0.106948316, +0.416614451E-1, -0.399641693, -0.871242821, -1.41021359, -0.995726764
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.357415020
354probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
355probKS
356+0.120246291
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+9, +4, +4, +5, +9, +2, +1, +4, +7, +4
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.355374098
365probKS = getProbKS(statKS, sum(iweight1))
366probKS
367+0.518560410E-5
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.355374098
371probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
372probKS
373+0.216852009
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378+1.09967041, +0.160599038, -1.21712554, +0.534283854E-1, +0.278614074, -0.451634914, -1.94911301, +0.205989987, -0.610692620
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.279159427
382probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
383probKS
384+0.419185698
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+8, +3, +1, +2, +9, +6, +1, +9, +8
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.228148341
393probKS = getProbKS(statKS, sum(iweight1))
394probKS
395+0.123286843E-1
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.228148341
399probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
400probKS
401+0.839703739
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406-1.55475152, +0.636219755E-1, -0.706179857, -0.442644775, -1.03599489, -2.05279970, -0.669263899, -0.910537541
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.545988679
410probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
411probKS
412+0.977969170E-2
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+4, +5, +6, +4, +3, +1, +6, +4
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.519473553
421probKS = getProbKS(statKS, sum(iweight1))
422probKS
423+0.00000000
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.519473553
427probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
428probKS
429+0.280191898E-1
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434-0.787099659, +0.620190382, +0.538606420E-1, -0.121582575, -0.447140932, +0.987637699, -0.425790995E-1, -1.17335820
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.228523076
438probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
439probKS
440+0.739855886
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+8, +7, +6, +8, +3, +7, +6, +4
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.192808807
449probKS = getProbKS(statKS, sum(iweight1))
450probKS
451+0.453805327E-1
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.192808807
455probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
456probKS
457+0.916038871
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462-0.662077367, -0.320136309, -0.696508467, +0.682200730, +0.690784156
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.244850636
466probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
467probKS
468+0.878592670
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+6, +7, +1, +6, +3
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.244850636
477probKS = getProbKS(statKS, sum(iweight1))
478probKS
479+0.107353330
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.244850636
483probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
484probKS
485+0.937239349
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490+2.41306520, -1.00105071, +0.310237646, +0.886133313, -0.550336421
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.221809894
494probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
495probKS
496+0.938402295
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+6, +5, +9, +9, +6
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.307524174
505probKS = getProbKS(statKS, sum(iweight1))
506probKS
507+0.194865465E-2
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.307524174
511probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
512probKS
513+0.675615668
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518+1.03488457, -0.354379743, -0.628104210, -0.828207731, -1.00397944, -0.248476490, -0.403357409E-1
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.373230189
522probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
523probKS
524+0.222258329
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+1, +6, +6, +5, +5, +2, +3
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.480373055
533probKS = getProbKS(statKS, sum(iweight1))
534probKS
535+0.244379044E-5
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.480373055
539probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
540probKS
541+0.955951214E-1
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546+0.339250684, +0.587200522, +1.44581890, +0.214912698, -1.00134695
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.385082304
550probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
551probKS
552+0.357555866
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+2, +6, +3, +3, +3
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.408611715
561probKS = getProbKS(statKS, sum(iweight1))
562probKS
563+0.454062223E-2
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.408611715
567probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
568probKS
569+0.366623282
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.934231997, +0.425366282, +0.383253515, +0.640175104, +0.813117325, +0.267769456, +0.791174710, +0.764962852, +0.200153947, +0.757163405
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.591842711, +0.341469049E-2, +0.431611955, +0.982068956, +0.338265896, +0.934400976
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.333333313
586probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
587probKS
588+0.703845620
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+6, +7, +5, +3, +8, +8, +8, +2, +8, +6
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.333333313
597probKS = getProbKS(statKS, sum(iweight1), nsam2)
598probKS
599+0.488745809
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.333333313
603probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
604probKS
605+0.725633025
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+7, +7, +7, +1, +8, +7
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.324767411
614probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
615probKS
616+0.115763545E-1
617probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618probKS
619+0.359466672
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.324767411
623probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624probKS
625+0.792926788
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.144581914, +0.723874748, +0.982209921, +0.335025728, +0.267206848, +0.562319458, +0.721729457
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.208220780, +0.759055138, +0.915828645, +0.621930838, +0.998717427, +0.330597699, +0.994642019, +0.983479083, +0.240846574
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+0.412698478
637probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
638probKS
639+0.404819667
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+3, +3, +9, +4, +8, +4, +7
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+0.333333313
648probKS = getProbKS(statKS, sum(iweight1), nsam2)
649probKS
650+0.324102938
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+0.333333313
654probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
655probKS
656+0.729050517
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+3, +3, +1, +8, +4, +7, +9, +7, +1
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+0.465116262
665probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
666probKS
667+0.183105469E-3
668probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669probKS
670+0.149224699
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+0.465116262
674probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675probKS
676+0.382951438
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.933533072, +0.647750139, +0.986048520, +0.371065497, +0.474206209E-1, +0.239380002E-1, +0.312445700, +0.318487883
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.633330107, +0.207078755, +0.374108016, +0.334971786, +0.437211394, +0.633070171, +0.595945120E-1, +0.292220712, +0.257508337, +0.921576738
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+0.275000036
688probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
689probKS
690+0.826498747
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+7, +4, +2, +1, +8, +3, +5, +5
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+0.314285725
699probKS = getProbKS(statKS, sum(iweight1), nsam2)
700probKS
701+0.357051194
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+0.314285725
705probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
706probKS
707+0.753080428
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+6, +9, +8, +4, +2, +6, +1, +4, +8, +6
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+0.314285725
716probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
717probKS
718+0.230964422E-1
719probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720probKS
721+0.542155743
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+0.314285725
725probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726probKS
727+0.790409505
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.668588996, +0.771800697, +0.663918674, +0.570029616E-1, +0.446385980, +0.914100409E-1, +0.124847531, +0.154986560
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.811889052, +0.280447006, +0.361677587, +0.287623227, +0.929665089, +0.234318316, +0.874609351
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.500000000
739probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
740probKS
741+0.216038346
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+4, +7, +2, +7, +3, +6, +4, +3
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.555555522
750probKS = getProbKS(statKS, sum(iweight1), nsam2)
751probKS
752+0.322006941E-1
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.555555522
756probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
757probKS
758+0.152144074
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+3, +5, +2, +4, +9, +7, +2
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.555555522
767probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
768probKS
769+0.268816948E-4
770probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771probKS
772+0.363840461E-1
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.555555522
776probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777probKS
778+0.201694727
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.330772519, +0.872871459, +0.582035840, +0.617837131, +0.488358974, +0.866998076, +0.575729847, +0.446105480, +0.115672529
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.867163658
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+0.888888896
790probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
791probKS
792+0.217448354
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+7, +4, +3, +6, +7, +4, +9, +6, +3
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+0.918367386
801probKS = getProbKS(statKS, sum(iweight1), nsam2)
802probKS
803+0.161637187
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+0.918367386
807probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
808probKS
809+0.191315413
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+9
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+0.918367386
818probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
819probKS
820+0.119209290E-5
821probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822probKS
823+0.455439091E-3
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+0.918367386
827probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828probKS
829+0.191315413
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.649592698, +0.793084264, +0.902936220, +0.335958004
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.190795302, +0.690337300, +0.326023102, +0.330879152
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.750000000
841probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
842probKS
843+0.107490480
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+7, +9, +6, +7
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.750000000
852probKS = getProbKS(statKS, sum(iweight1), nsam2)
853probKS
854+0.174044371E-1
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.750000000
858probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
859probKS
860+0.110439181
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+1, +1, +1, +2
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.800000012
869probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
870probKS
871+0.327938795E-2
872probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873probKS
874+0.549650192E-1
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.800000012
878probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879probKS
880+0.863485336E-1
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.158787251, +0.503024340, +0.185945153
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.546325684
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+1.00000000
892probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
893probKS
894+0.167768300
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+3, +9, +4
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+1.00000000
903probKS = getProbKS(statKS, sum(iweight1), nsam2)
904probKS
905+0.110363066
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+1.00000000
909probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
910probKS
911+0.184250176
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+8
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+1.00000000
920probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
921probKS
922+0.935792923E-5
923probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924probKS
925+0.151254535E-1
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+1.00000000
929probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930probKS
931+0.184250176
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.633870065, +0.792132318, +0.296993196, +0.646297634, +0.532432199E-1, +0.398275852E-1, +0.940089941, +0.197900534E-1
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.362821817E-1, +0.638007402, +0.554875433, +0.335331380, +0.514576554, +0.897355914
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+0.333333313
943probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
944probKS
945+0.749077678
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+8, +6, +5, +2, +9, +9, +7, +2
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+0.354166687
954probKS = getProbKS(statKS, sum(iweight1), nsam2)
955probKS
956+0.424849272
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+0.354166687
960probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
961probKS
962+0.720435381
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+7, +6, +2, +3, +2, +6
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+0.251602590
971probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
972probKS
973+0.202203989
974probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975probKS
976+0.832699001
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+0.251602590
980probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981probKS
982+0.980041564
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.536787868, +0.958667457, +0.605838418, +0.713409603, +0.439950526, +0.195576012, +0.658283830E-1, +0.564221442, +0.367155850, +0.747975886
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.895007849E-1, +0.294569075, +0.515230775, +0.666793823, +0.367471397
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+0.400000006
994probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
995probKS
996+0.540248156
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+3, +8, +6, +3, +6, +7, +6, +7, +2, +6
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+0.411111116
1005probKS = getProbKS(statKS, sum(iweight1), nsam2)
1006probKS
1007+0.327570558
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+0.411111116
1011probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012probKS
1013+0.527879894
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+4, +1, +3, +2, +8
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+0.500000000
1022probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1023probKS
1024+0.133478642E-2
1025probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026probKS
1027+0.672885776E-1
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+0.500000000
1031probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032probKS
1033+0.416762352
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.484630883, +0.577707827, +0.989745736, +0.658459961, +0.559964180
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.953786075, +0.656581283, +0.331942439, +0.241036177, +0.756387353, +0.861041546
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+0.333333343
1045probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
1046probKS
1047+0.847054422
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+4, +6, +1, +1, +9
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+0.571428537
1056probKS = getProbKS(statKS, sum(iweight1), nsam2)
1057probKS
1058+0.575079918E-1
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+0.571428537
1062probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063probKS
1064+0.336351275
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+9, +1, +7, +2, +2, +7
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+0.595238090
1073probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1074probKS
1075+0.189423561E-3
1076probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077probKS
1078+0.157055736
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+0.595238090
1082probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083probKS
1084+0.358602405
1085
1086
Test:
test_pm_statest
Internal naming convention:
The following illustrates the internal naming convention used for the procedures within this generic interface.
getProbKS_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 196 of file pm_statest.F90.


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