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.302847862
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.697152138
13probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
14probKS
15+0.454001367
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+4
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.697152138
24probKS = getProbKS(statKS, sum(iweight1))
25probKS
26+0.201364756E-1
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.697152138
30probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
31probKS
32+0.454001367
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.230154216, +0.824731588E-2, +0.812823772, +0.494708002, +0.415701628, +0.866462886, +0.431321621, +0.813370705, +0.791037381
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.235481799
41probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
42probKS
43+0.638391733
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+1, +6, +1, +1, +7, +6, +3, +7, +3
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.276751637
52probKS = getProbKS(statKS, sum(iweight1))
53probKS
54+0.728166103E-2
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.276751637
58probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
59probKS
60+0.633723140
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.231356204, +0.126278281, +0.887744308, +0.952601254, +0.921268046, +0.713880777, +0.758632183
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.428166479
69probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
70probKS
71+0.111175060
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+9, +7, +9, +9, +3, +9, +3
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.387350172
80probKS = getProbKS(statKS, sum(iweight1))
81probKS
82+0.476837158E-6
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.387350172
86probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
87probKS
88+0.245611846
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.301886976, +0.138111234
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.698113024
97probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
98probKS
99+0.158785522
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+8, +3
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.698113024
108probKS = getProbKS(statKS, sum(iweight1))
109probKS
110+0.160336494E-4
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.698113024
114probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
115probKS
116+0.227472425
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.275684774, +0.745084405, +0.627937376, +0.669842958E-1, +0.656701505, +0.552377284, +0.908759356, +0.222776830, +0.106731951
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.168759674
125probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
126probKS
127+0.939101815
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+7, +5, +8, +9, +8, +1, +6, +7, +2
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.196013331
136probKS = getProbKS(statKS, sum(iweight1))
137probKS
138+0.292441845E-1
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.196013331
142probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
143probKS
144+0.902157545
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.589836538
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.589836538
153probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
154probKS
155+0.668474436
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+3
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.589836538
164probKS = getProbKS(statKS, sum(iweight1))
165probKS
166+0.155591309
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.589836538
170probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
171probKS
172+0.668474436
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.478052437, +0.575801909, +0.170047164, +0.207371831, +0.150430620, +0.230965734, +0.858748436, +0.296061993, +0.745531321, +0.747784972E-1
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.303938031
181probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
182probKS
183+0.261332750
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+4, +9, +9, +1, +6, +7, +9, +2, +8, +6
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.244444072
192probKS = getProbKS(statKS, sum(iweight1))
193probKS
194+0.106036663E-2
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.244444072
198probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
199probKS
200+0.640020490
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.337312222, +0.901388586
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.401388586
209probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
210probKS
211+0.796587467
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+7, +9
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.463888586
220probKS = getProbKS(statKS, sum(iweight1))
221probKS
222+0.121837854E-2
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.463888586
226probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
227probKS
228+0.638959050
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.860689223, +0.749649167, +0.212841451, +0.221081972, +0.530286610
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.212841451
237probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
238probKS
239+0.955790818
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+8, +7, +4, +4, +2
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.349649191
248probKS = getProbKS(statKS, sum(iweight1))
249probKS
250+0.311440229E-2
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.349649191
254probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
255probKS
256+0.582229853
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.322500825
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.677499175
265probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
266probKS
267+0.490994573
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+3
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.677499175
276probKS = getProbKS(statKS, sum(iweight1))
277probKS
278+0.688785315E-1
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.677499175
282probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
283probKS
284+0.490994573
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.792379737, -0.813195229, -0.510598242, +0.382817417, +0.120958075, +1.54223812
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.208053082
298probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
299probKS
300+0.928778708
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+9, +3, +2, +9, +8, +8
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.208053082
309probKS = getProbKS(statKS, sum(iweight1))
310probKS
311+0.587989092E-1
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.208053082
315probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
316probKS
317+0.963093281
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322+2.15230751, -0.862318575, -0.580217600, +0.361171722, -0.646640897, +2.14648771, +2.78114915, -0.484589964
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.359082937
326probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
327probKS
328+0.200046480
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+2, +1, +7, +4, +3, +3, +7, +4
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.371179700
337probKS = getProbKS(statKS, sum(iweight1))
338probKS
339+0.252783298E-3
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.371179700
343probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
344probKS
345+0.279679835
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350-1.02140808, +1.59703720, +0.610186875, +0.778985098E-1, -0.288317710, -1.86103022
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.179802775
354probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
355probKS
356+0.979945064
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+1, +8, +8, +8, +3, +5
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.258318335
365probKS = getProbKS(statKS, sum(iweight1))
366probKS
367+0.197053552E-1
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.258318335
371probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
372probKS
373+0.851097822
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378-0.866718829, -0.943031847, -0.948334813, -1.13487947, -0.658094704, +0.173487604
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.578094721
382probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
383probKS
384+0.207475424E-1
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+5, +9, +6, +5, +4, +8
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.528545201
393probKS = getProbKS(statKS, sum(iweight1))
394probKS
395+0.00000000
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.528545201
399probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
400probKS
401+0.573992133E-1
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406-0.158663969E-1, +0.249184623, -0.405293286, +1.05621457, -1.49081731, -0.699317932, -1.27065957, -1.14455914, +1.01230884
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.212924600
410probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
411probKS
412+0.756984174
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+9, +1, +3, +9, +1, +1, +9, +5, +9
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.227283537
421probKS = getProbKS(statKS, sum(iweight1))
422probKS
423+0.128126740E-1
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.227283537
427probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
428probKS
429+0.864800632
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434+2.64394498, -0.874580443, +0.250181377, -1.18626332, +0.916883409, -1.14391220, -0.305221379, -0.217151083E-2, +0.711415589, +1.72289348
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.161586583
438probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
439probKS
440+0.936182141
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+1, +5, +4, +8, +8, +8, +7, +7, +1, +5
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.197987765
449probKS = getProbKS(statKS, sum(iweight1))
450probKS
451+0.247902274E-1
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.197987765
455probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
456probKS
457+0.868955672
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462+0.580808342, +0.131562337, -0.879199445, +1.45237088, +0.148051053, -3.38608170, -0.223906100, +0.442292064, -0.339343995, -0.648048341
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.180684865
466probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
467probKS
468+0.865151525
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+6, +9, +4, +5, +1, +1, +9, +8, +2, +6
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.182645619
477probKS = getProbKS(statKS, sum(iweight1))
478probKS
479+0.584378242E-1
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.182645619
483probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
484probKS
485+0.940833151
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490+0.284834951, -0.374169439, -1.18516827, -1.21960366, -0.826427877, -0.353151150E-1, +0.219908670, -0.508771092E-1
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.387885273
494probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
495probKS
496+0.136352658
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+8, +3, +9, +9, +6, +9, +3, +7
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.387885273
505probKS = getProbKS(statKS, sum(iweight1))
506probKS
507+0.119209290E-6
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.387885273
511probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
512probKS
513+0.180083334
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518-0.162563056, +1.07349551, -1.24041593, +0.331466824, +0.100684859, +1.05376613, +0.382466376, +1.05344319
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.310431242
522probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
523probKS
524+0.356083095
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+7, +1, +2, +8, +6, +3, +3, +8
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.382799655
533probKS = getProbKS(statKS, sum(iweight1))
534probKS
535+0.175833702E-4
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.382799655
539probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
540probKS
541+0.259592414
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546-1.62941992, -0.292969104E-1, -0.343095660, -0.837777317, +0.694119036, -1.06800473, +1.26200175, +0.279819090E-1, +0.348556370
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.155505002
550probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
551probKS
552+0.969481647
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+5, +5, +5, +2, +5, +5, +2, +3, +9
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.195023239
561probKS = getProbKS(statKS, sum(iweight1))
562probKS
563+0.772454143E-1
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.195023239
567probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
568probKS
569+0.905113459
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.901894808, +0.524454117, +0.765429735, +0.698456228, +0.979507565E-1, +0.732012391E-1
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.930930018, +0.689961553, +0.354033113, +0.325182855, +0.445175171E-2, +0.694705129, +0.133988559, +0.832012057
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.250000000
586probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
587probKS
588+0.958762407
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+5, +4, +3, +1, +3, +6
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.284090936
597probKS = getProbKS(statKS, sum(iweight1), nsam2)
598probKS
599+0.652292490
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.284090936
603probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
604probKS
605+0.921341598
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+6, +2, +4, +5, +2, +8, +3, +1
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.344574809
614probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
615probKS
616+0.724661946E-1
617probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618probKS
619+0.581816554
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.344574809
623probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624probKS
625+0.814096987
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.438950181, +0.645309269, +0.214996636, +0.700547218, +0.333307922, +0.529284060, +0.362345517, +0.123621225
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.722660303, +0.895832002, +0.839340627
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+1.00000000
637probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
638probKS
639+0.748288631E-2
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+4, +2, +6, +8, +7, +7, +4, +6
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+1.00000000
648probKS = getProbKS(statKS, sum(iweight1), nsam2)
649probKS
650+0.195533037E-2
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+1.00000000
654probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
655probKS
656+0.863760710E-2
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+2, +2, +9
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+1.00000000
665probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
666probKS
667+0.00000000
668probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669probKS
670+0.419020653E-4
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+1.00000000
674probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675probKS
676+0.325298309E-1
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.385917723, +0.816458583, +0.845681250, +0.173637331, +0.754182279, +0.644990802, +0.835732937, +0.775341094, +0.861362755, +0.307881653
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.142723083, +0.338826180E-1, +0.879827142E-1, +0.421717107, +0.324221373
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+0.699999988
688probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
689probKS
690+0.387594104E-1
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+7, +6, +5, +7, +9, +9, +8, +4, +7, +6
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+0.705882311
699probKS = getProbKS(statKS, sum(iweight1), nsam2)
700probKS
701+0.897961855E-2
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+0.705882311
705probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
706probKS
707+0.384696722E-1
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+8, +4, +1, +1, +5
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+0.756191969
716probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
717probKS
718+0.00000000
719probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720probKS
721+0.536382198E-3
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+0.756191969
725probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726probKS
727+0.560653210E-1
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.540120006, +0.770794868, +0.897860825, +0.343911588
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.233095109, +0.373438835, +0.290213227, +0.270098209, +0.258855462
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.800000012
739probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
740probKS
741+0.529221892E-1
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+1, +2, +8, +7
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.800000012
750probKS = getProbKS(statKS, sum(iweight1), nsam2)
751probKS
752+0.527745485E-2
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.800000012
756probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
757probKS
758+0.983899832E-1
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+7, +5, +5, +3, +1
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.761904776
767probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
768probKS
769+0.822544098E-5
770probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771probKS
772+0.573902726E-1
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.761904776
776probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777probKS
778+0.154524744
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.989955544, +0.276692569, +0.205381453
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.741168559
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+0.666666687
790probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
791probKS
792+0.640599132
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+1, +9, +6
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+0.937500000
801probKS = getProbKS(statKS, sum(iweight1), nsam2)
802probKS
803+0.156689405
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+0.937500000
807probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
808probKS
809+0.256553531
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+1
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+0.937500000
818probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
819probKS
820+0.156689405
821probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822probKS
823+0.256553531
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+0.937500000
827probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828probKS
829+0.256553531
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.708028853, +0.731888413E-1, +0.497773826, +0.427994013, +0.481690705
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.457938135, +0.792325914, +0.389327466, +0.569079340
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.300000012
841probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
842probKS
843+0.960419297
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+3, +2, +1, +8, +6
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.350000024
852probKS = getProbKS(statKS, sum(iweight1), nsam2)
853probKS
854+0.707741380
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.350000024
858probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
859probKS
860+0.924145758
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+9, +2, +2, +3
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.375000000
869probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
870probKS
871+0.125287652
872probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873probKS
874+0.702130616
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.375000000
878probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879probKS
880+0.934725583
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.197341144, +0.739267588, +0.551396072
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.386786997, +0.455212355, +0.389451742, +0.132000208, +0.907285094, +0.854464829, +0.177605927, +0.342428505
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+0.416666657
892probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
893probKS
894+0.717075586
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+6, +7, +5
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+0.416666657
903probKS = getProbKS(statKS, sum(iweight1), nsam2)
904probKS
905+0.220154047
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+0.416666657
909probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
910probKS
911+0.723529816
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+4, +3, +6, +9, +5, +3, +6, +5
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+0.471544713
920probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
921probKS
922+0.472474098E-2
923probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924probKS
925+0.436094582
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+0.471544713
929probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930probKS
931+0.588949203
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.610466957, +0.730848789, +0.359789848, +0.985602319, +0.264157832, +0.689871848
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.527738929
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+0.666666627
943probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
944probKS
945+0.582934380
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+3, +4, +8, +9, +5, +8
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+0.648648620
954probKS = getProbKS(statKS, sum(iweight1), nsam2)
955probKS
956+0.560160279
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+0.648648620
960probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
961probKS
962+0.626385570
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+4
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+0.648648620
971probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
972probKS
973+0.528704524E-1
974probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975probKS
976+0.174695313
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+0.648648620
980probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981probKS
982+0.626385570
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.749032676, +0.864301682, +0.992489040, +0.527875721, +0.230364799
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.146719813E-1, +0.310063958E-1, +0.411042511, +0.403165162, +0.191839993, +0.673525453, +0.757620513, +0.966015399, +0.527426898
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+0.466666698
994probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
995probKS
996+0.364010692
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+6, +5, +5, +3, +2
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+0.571428597
1005probKS = getProbKS(statKS, sum(iweight1), nsam2)
1006probKS
1007+0.187653899E-1
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+0.571428597
1011probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012probKS
1013+0.184545815
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+8, +3, +2, +4, +2, +9, +3, +4, +3
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+0.577694178
1022probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1023probKS
1024+0.113308430E-3
1025probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026probKS
1027+0.858314037E-1
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+0.577694178
1031probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032probKS
1033+0.214641809
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.474074602, +0.540832162, +0.923044622
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.398885846, +0.203049183E-1
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+1.00000000
1045probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
1046probKS
1047+0.626705289E-1
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+1, +4, +9
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+1.00000000
1056probKS = getProbKS(statKS, sum(iweight1), nsam2)
1057probKS
1058+0.189799070E-1
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+1.00000000
1062probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063probKS
1064+0.970269442E-1
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+8, +7
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+1.00000000
1073probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1074probKS
1075+0.178813934E-6
1076probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077probKS
1078+0.183859468E-1
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+1.00000000
1082probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083probKS
1084+0.974988937E-1
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: