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.462093949E-1, +0.710788310, +0.936869979, +0.436532557, +0.424030721, +0.132807255, +0.789889216, +0.317272782
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.188467443
13call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
14[probKS, quanKS]
15+0.909156799, +0.563012123
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+5, +2, +3, +8, +8, +8, +5, +4
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.330909312
24call setProbKS(probKS, quanKS, statKS, sum(iweight1))
25[probKS, quanKS]
26+0.109374523E-3, +2.21517730
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.330909312
30call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
31[probKS, quanKS]
32+0.368361235, +0.918000698
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.834564388, +0.625491440, +0.536503911, +0.147221684, +0.173407614, +0.291324019
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.208675981
41call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
42[probKS, quanKS]
43+0.927204132, +0.545561850
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+5, +1, +2, +3, +8, +8
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.412379682
52call setProbKS(probKS, quanKS, statKS, sum(iweight1))
53[probKS, quanKS]
54+0.123918056E-3, +2.20100307
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.412379682
58call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
59[probKS, quanKS]
60+0.349074960, +0.932790995
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.293232441, +0.768743753E-1, +0.454477906, +0.260488391E-1, +0.170449793, +0.930680454, +0.751234889
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.278196156
69call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
70[probKS, quanKS]
71+0.575362146, +0.780987680
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+7, +2, +4, +3, +7, +3, +2
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.385339022
80call setProbKS(probKS, quanKS, statKS, sum(iweight1))
81[probKS, quanKS]
82+0.312626362E-3, +2.09327364
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.385339022
86call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
87[probKS, quanKS]
88+0.296584189, +0.976031005
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.138544738, +0.329213619, +0.922741592, +0.848024964, +0.162009537, +0.654602826, +0.239861608E-1, +0.646164477, +0.934737682, +0.390312374
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.148024976
97call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
98[probKS, quanKS]
99+0.969406486, +0.491008103
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+5, +9, +3, +7, +1, +3, +7, +8, +3, +7
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.156857431
108call setProbKS(probKS, quanKS, statKS, sum(iweight1))
109[probKS, quanKS]
110+0.133600116, +1.16313219
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.156857431
114call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
115[probKS, quanKS]
116+0.978896916, +0.472450554
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.557841420, +0.824282885, +0.640297532, +0.896061838, +0.654752910, +0.478424013, +0.295103192, +0.550536036
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.353424013
125call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
126[probKS, quanKS]
127+0.214921236, +1.05578983
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+8, +5, +3, +1, +6, +4, +8, +8
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.295103192
136call setProbKS(probKS, quanKS, statKS, sum(iweight1))
137[probKS, quanKS]
138+0.815331936E-3, +1.97548366
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.295103192
142call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
143[probKS, quanKS]
144+0.531636715, +0.807718694
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.394541562, +0.453168809, +0.497177958, +0.448671341, +0.876755595, +0.672079384, +0.749120057, +0.823256135
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.394541562
153call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
154[probKS, quanKS]
155+0.124258935, +1.17862105
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+8, +1, +9, +9, +7, +8, +5, +7
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.394541562
164call setProbKS(probKS, quanKS, statKS, sum(iweight1))
165[probKS, quanKS]
166+0.596046448E-7, +2.95252728
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.394541562
170call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
171[probKS, quanKS]
172+0.169451952, +1.11079335
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.781156957, +0.364391625, +0.395387113
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.364391625
181call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
182[probKS, quanKS]
183+0.714539230, +0.698013783
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+8, +7, +2
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.364391625
192call setProbKS(probKS, quanKS, statKS, sum(iweight1))
193[probKS, quanKS]
194+0.157906413E-1, +1.55587375
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.364391625
198call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
199[probKS, quanKS]
200+0.804400861, +0.641927123
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.977708399, +0.376907170, +0.608141720, +0.136100054, +0.681608438, +0.369262159, +0.698377192
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.226405010
209call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
210[probKS, quanKS]
211+0.813950419, +0.635592937
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+1, +8, +5, +9, +9, +4, +6
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.277813315
220call setProbKS(probKS, quanKS, statKS, sum(iweight1))
221[probKS, quanKS]
222+0.231826305E-2, +1.83848906
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.277813315
226call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
227[probKS, quanKS]
228+0.685740709, +0.715238631
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.328853607, +0.128225565, +0.706415117, +0.763041019, +0.327821493
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.271146417
237call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
238[probKS, quanKS]
239+0.788631976, +0.652177989
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+4, +8, +3, +7, +2
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.254479766
248call setProbKS(probKS, quanKS, statKS, sum(iweight1))
249[probKS, quanKS]
250+0.743635893E-1, +1.28294277
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.254479766
254call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
255[probKS, quanKS]
256+0.915648341, +0.556967616
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.706836164, +0.897259057, +0.610983253, +0.574858725, +0.234868765, +0.887131929, +0.552479744, +0.856926322
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.427479744
265call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
266[probKS, quanKS]
267+0.766536593E-1, +1.27701783
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+2, +2, +2, +7, +2, +7, +8, +5
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.495336890
276call setProbKS(probKS, quanKS, statKS, sum(iweight1))
277[probKS, quanKS]
278+0.596046448E-7, +2.99910307
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.495336890
282call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
283[probKS, quanKS]
284+0.686516762E-1, +1.29842520
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-1.07710052, +0.579971410E-1, -0.901451886, +1.10311115, -1.61663270, -0.316098779, -0.820439756, -0.121743955, -0.356857955
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.365764320
298call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
299[probKS, quanKS]
300+0.138987303, +1.15459597
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+7, +4, +9, +3, +1, +5, +3, +9, +7
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.414375424
309call setProbKS(probKS, quanKS, statKS, sum(iweight1))
310[probKS, quanKS]
311+0.596046448E-7, +2.92718124
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.414375424
315call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
316[probKS, quanKS]
317+0.124272406, +1.17859805
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322-0.738163173, -0.929830909, +0.182129905, -0.211889341, -1.24427760, +0.462930560, +1.45061707, +0.964271069
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.144792348
326call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
327[probKS, quanKS]
328+0.992069840, +0.432540745
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+5, +7, +3, +2, +5, +4, +7, +4
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.229251832
337call setProbKS(probKS, quanKS, statKS, sum(iweight1))
338[probKS, quanKS]
339+0.342314243E-1, +1.42614055
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.229251832
343call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
344[probKS, quanKS]
345+0.795798063, +0.647549391
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350+0.452653378, +0.189940915, -0.288046956, -0.757188424E-1, -0.840262175E-1, -0.372982621, +0.467030376, +1.88693345
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.354580700
354call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
355[probKS, quanKS]
356+0.211814046, +1.05924523
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+2, +7, +1, +4, +3, +8, +5, +8
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.354580700
365call setProbKS(probKS, quanKS, statKS, sum(iweight1))
366[probKS, quanKS]
367+0.919699669E-4, +2.23465896
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.354580700
371call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
372[probKS, quanKS]
373+0.336406946, +0.942799389
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378-1.13216770, +0.180436075, +2.22999048, -0.244090948E-1, -0.528654575
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.228405118
382call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
383[probKS, quanKS]
384+0.923444092, +0.549373984
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+8, +3, +5, +1, +5
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.292386591
393call setProbKS(probKS, quanKS, statKS, sum(iweight1))
394[probKS, quanKS]
395+0.368086696E-1, +1.41335821
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.292386591
399call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
400[probKS, quanKS]
401+0.823685944, +0.629021764
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406+0.721646845, -0.920135617, -1.24234748, +0.281262279, +0.128498092
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.235255837
410call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
411[probKS, quanKS]
412+0.906021237, +0.565851748
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+9, +2, +8, +3, +2
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.237915725
421call setProbKS(probKS, quanKS, statKS, sum(iweight1))
422[probKS, quanKS]
423+0.112553596, +1.19943631
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.237915725
427call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
428[probKS, quanKS]
429+0.969384074, +0.491047144
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434+1.39941919, +0.785788119, +1.18587971, -0.974316239, +0.325524300, +1.21735024, +1.01278782, +1.38540924, +0.740205050, +0.180610251E-1
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.470412195
438call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
439[probKS, quanKS]
440+0.153526664E-1, +1.56038666
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+1, +6, +9, +3, +4, +8, +7, +8, +8, +6
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.553745508
449call setProbKS(probKS, quanKS, statKS, sum(iweight1))
450[probKS, quanKS]
451+0.00000000, +4.36360741
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.553745508
455call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
456[probKS, quanKS]
457+0.583142042E-2, +1.70845556
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462-0.939637303, -0.958494365, +0.678141475, +0.662435889, +0.447554529, -0.286700934, -1.01861858, -0.678163841E-1, +0.589176044E-1
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.248841047
466call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
467[probKS, quanKS]
468+0.567890644, +0.785508215
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+3, +3, +9, +8, +4, +8, +1, +5, +2
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.248841047
477call setProbKS(probKS, quanKS, statKS, sum(iweight1))
478[probKS, quanKS]
479+0.777691603E-2, +1.66579497
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.248841047
483call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
484[probKS, quanKS]
485+0.731137514, +0.687982202
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490+0.633937418, +1.09282386, -1.02886736, -0.984259009, -0.370697379, +0.737456322, -0.786807165E-1
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.165510595
494call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
495[probKS, quanKS]
496+0.982207775, +0.464642406
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+7, +1, +1, +6, +3, +9, +8
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.222653449
505call setProbKS(probKS, quanKS, statKS, sum(iweight1))
506[probKS, quanKS]
507+0.527819991E-1, +1.34809387
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.222653449
511call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
512[probKS, quanKS]
513+0.932908416, +0.539564669
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518-1.33879030, -0.416459560, +0.756268799, -0.151113719, -0.556740284
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.360056996
522call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
523[probKS, quanKS]
524+0.441297233, +0.866031170
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+8, +5, +6, +2, +6
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.365166813
533call setProbKS(probKS, quanKS, statKS, sum(iweight1))
534[probKS, quanKS]
535+0.100362301E-2, +1.94901276
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.365166813
539call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
540[probKS, quanKS]
541+0.495421350, +0.830491364
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546+1.13246191, -0.163309902, +1.45164311, -1.37653434, +0.634082377, -0.925304666E-1, -0.431567222, +0.370602429, +0.959321260E-1
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.221916914
550call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
551[probKS, quanKS]
552+0.710373282, +0.700517714
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+1, +8, +9, +5, +8, +9, +1, +2, +8
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.317490160
561call setProbKS(probKS, quanKS, statKS, sum(iweight1))
562[probKS, quanKS]
563+0.461935997E-4, +2.31032252
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.317490160
567call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
568[probKS, quanKS]
569+0.425611079, +0.876755834
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.729944110E-1, +0.292358339, +0.850409448, +0.535985529, +0.775059819, +0.838557482, +0.534521818
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.151084900, +0.442842245E-1, +0.606431603, +0.657666087, +0.712000012, +0.346039116
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.428571403
586call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
587[probKS, quanKS]
588+0.468385160, +0.847985268
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+7, +6, +2, +5, +9, +7, +6
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.428571403
597call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
598[probKS, quanKS]
599+0.216559172, +1.05398381
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.428571403
603call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
604[probKS, quanKS]
605+0.496777236, +0.829626024
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+5, +3, +4, +5, +4, +8
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.428571403
614call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
615[probKS, quanKS]
616+0.232851505E-2, +1.83788955
617call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618[probKS, quanKS]
619+0.222841144, +1.04715168
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.428571403
623call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624[probKS, quanKS]
625+0.526714444, +0.810775459
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.182802260, +0.435226500, +0.342259824, +0.848885238, +0.793749094E-2, +0.186996460E-1, +0.792677462, +0.124009192, +0.517213523
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.914154053E-1, +0.311941445, +0.689440489
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+0.222222239
637call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
638[probKS, quanKS]
639+0.998904228, +0.376296341
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+1, +6, +8, +1, +2, +1, +9, +5, +8
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+0.447154492
648call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
649[probKS, quanKS]
650+0.495091140, +0.830702305
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+0.447154492
654call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
655[probKS, quanKS]
656+0.674469590, +0.721939981
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+9, +9, +3
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+0.637630701
665call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
666[probKS, quanKS]
667+0.989437103E-5, +2.47149301
668call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669[probKS, quanKS]
670+0.232552886E-1, +1.49237537
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+0.637630701
674call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675[probKS, quanKS]
676+0.284801602, +0.986456454
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.115207791, +0.632531166, +0.222090781, +0.622100115, +0.260065496, +0.874881208, +0.281625092, +0.766614556
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.684771240, +0.890695155, +0.632822871
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+0.750000000
688call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
689[probKS, quanKS]
690+0.862641931E-1, +1.25367618
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+4, +4, +1, +8, +4, +5, +3, +2
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+0.774193525
699call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
700[probKS, quanKS]
701+0.344915986E-1, +1.42481267
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+0.774193525
705call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
706[probKS, quanKS]
707+0.844048858E-1, +1.25801468
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+7, +3, +9
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+0.774193525
716call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
717[probKS, quanKS]
718+0.417232513E-6, +2.77490282
719call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720[probKS, quanKS]
721+0.260990858E-2, +1.82230318
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+0.774193525
725call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726[probKS, quanKS]
727+0.108509362, +1.20704317
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.681682706, +0.474893093, +0.400363803E-1, +0.173177540, +0.708695829, +0.401317418, +0.806037784, +0.879518330, +0.425145328
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.179218054E-1, +0.613272190E-3, +0.713434100, +0.284566820, +0.278666437, +0.944865644, +0.830909371, +0.517890036, +0.420068920
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.222222239
739call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
740[probKS, quanKS]
741+0.957474530, +0.509594440
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+9, +8, +6, +2, +8, +7, +3, +2, +3
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.277777791
750call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
751[probKS, quanKS]
752+0.529327154, +0.809151530
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.277777791
756call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
757[probKS, quanKS]
758+0.858717918, +0.604166687
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+7, +3, +3, +5, +7, +2, +2, +9, +3
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.369918644
767call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
768[probKS, quanKS]
769+0.323653221E-2, +1.79254079
770call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771[probKS, quanKS]
772+0.296280742, +0.976295710
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.369918644
776call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777[probKS, quanKS]
778+0.604132056, +0.763716221
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.412214339, +0.821229756
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.830083013, +0.111075819, +0.265309751, +0.837992907, +0.828698277, +0.939627945, +0.193344474
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+0.571428537
790call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
791[probKS, quanKS]
792+0.493583679, +0.831665814
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+7, +3
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+0.571428537
801call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
802[probKS, quanKS]
803+0.839494467E-1, +1.25908971
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+0.571428537
807call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
808[probKS, quanKS]
809+0.553744972, +0.794115961
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+1, +5, +7, +2, +9, +5, +2
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+0.548387110
818call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
819[probKS, quanKS]
820+0.122885108E-1, +1.59565651
821call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822[probKS, quanKS]
823+0.521783650, +0.813848794
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+0.548387110
827call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828[probKS, quanKS]
829+0.641955614, +0.741223812
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.188365698, +0.630830526E-1, +0.873363793, +0.343774021, +0.653704464, +0.884383857, +0.103310764, +0.590547383
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.850090504, +0.526823997
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.500000000
841call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
842[probKS, quanKS]
843+0.650872827, +0.735936821
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+2, +8, +8, +5, +9, +5, +9, +3
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.489795923
852call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
853[probKS, quanKS]
854+0.582638144, +0.776600718
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.489795923
858call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
859[probKS, quanKS]
860+0.692809105, +0.711026847
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+2, +8
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.489795923
869call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
870[probKS, quanKS]
871+0.237292647E-1, +1.48899150
872call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873[probKS, quanKS]
874+0.201473296, +1.07103217
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.489795923
878call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879[probKS, quanKS]
880+0.797627270, +0.646360159
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.267207086, +0.866126001, +0.260619998, +0.330209136, +0.202800035E-1, +0.448052049
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.972234368, +0.103491545, +0.596077502, +0.575129926
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+0.583333373
892call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
893[probKS, quanKS]
894+0.254147887, +1.01511562
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+1, +9, +3, +4, +2, +4
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+0.358695686
903call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
904[probKS, quanKS]
905+0.666718602, +0.726540804
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+0.358695686
909call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
910[probKS, quanKS]
911+0.885901511, +0.583048105
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+4, +5, +8, +5
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+0.381422937
920call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
921[probKS, quanKS]
922+0.559325814E-1, +1.33729839
923call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924[probKS, quanKS]
925+0.573691070, +0.781997323
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+0.381422937
929call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930[probKS, quanKS]
931+0.850094080, +0.610490978
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.471541286, +0.970145047, +0.117306292, +0.335978866E-1, +0.179242313
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.813838899, +0.501815140, +0.301373541, +0.571858943, +0.141342640, +0.712355733
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+0.466666669
943call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
944[probKS, quanKS]
945+0.453609407, +0.857758522
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+3, +5, +9, +5, +3
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+0.559999943
954call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
955[probKS, quanKS]
956+0.590751171E-1, +1.32703936
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+0.559999943
960call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
961[probKS, quanKS]
962+0.284989536, +0.986287832
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+5, +5, +6, +1, +8, +3
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+0.559999943
971call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
972[probKS, quanKS]
973+0.251054764E-3, +2.11931229
974call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975[probKS, quanKS]
976+0.129963994, +1.16905308
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+0.559999943
980call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981[probKS, quanKS]
982+0.327440262, +0.950036883
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.702799737, +0.288385153E-2
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.646555543, +0.275221169, +0.676584899, +0.113600492E-2, +0.559577525, +0.732959569, +0.301678061, +0.673682570
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+0.375000000
994call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
995[probKS, quanKS]
996+0.920842350, +0.551952600
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+9, +8
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+0.404411763
1005call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1006[probKS, quanKS]
1007+0.258556008, +1.01084447
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+0.404411763
1011call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012[probKS, quanKS]
1013+0.871370435, +0.594585121
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+4, +4, +4, +2, +1, +4, +2, +9
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+0.403921574
1022call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1023[probKS, quanKS]
1024+0.413758755E-1, +1.39251494
1025call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026[probKS, quanKS]
1027+0.817562938, +0.633168757
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+0.403921574
1031call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032[probKS, quanKS]
1033+0.892788172, +0.577342033
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.156207800, +0.735452354, +0.307618022, +0.792486310, +0.353777647, +0.208282650
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.732567489, +0.503451109, +0.483844757, +0.800864756, +0.243870616, +0.138783336
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+0.333333343
1045call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
1046[probKS, quanKS]
1047+0.809557319, +0.638519764
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+3, +2, +6, +1, +7, +7
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+0.551282167
1056call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1057[probKS, quanKS]
1058+0.643532872E-1, +1.31081676
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+0.551282167
1062call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063[probKS, quanKS]
1064+0.279125988, +0.991588354
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+5, +1, +3, +8, +3, +9
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+0.470822394
1073call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1074[probKS, quanKS]
1075+0.277757645E-2, +1.81374347
1076call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077[probKS, quanKS]
1078+0.251361251, +1.01784384
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+0.470822394
1082call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083[probKS, quanKS]
1084+0.547648847, +0.797847271
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: