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.760522485E-1, +0.242145419, +0.911414087, +0.802966714, +0.518629551E-1, +0.532067001, +0.607682347
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.209662050
13probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
14probKS
15+0.879020572
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+2, +4, +9, +7, +2, +7, +5
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.309844792
24probKS = getProbKS(statKS, sum(iweight1))
25probKS
26+0.144225359E-2
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.309844792
30probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
31probKS
32+0.560173213
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.432508171, +0.261734426, +0.201474965, +0.868292809
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.317491829
41probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
42probKS
43+0.726912737
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+2, +3, +4, +9
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.368292809
52probKS = getProbKS(statKS, sum(iweight1))
53probKS
54+0.107638836E-1
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.368292809
58probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
59probKS
60+0.711440682
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.759366393, +0.925849974, +0.627367437, +0.982025325
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.627367437
69probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
70probKS
71+0.482808948E-1
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+7, +9, +1, +9
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.720904827
80probKS = getProbKS(statKS, sum(iweight1))
81probKS
82+0.00000000
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.720904827
86probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
87probKS
88+0.358075500E-1
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.865392148, +0.805033326, +0.542861819, +0.289520323, +0.188381970, +0.181042314
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.210479677
97probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
98probKS
99+0.922537923
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+9, +4, +6, +9, +6, +4
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.210479677
108probKS = getProbKS(statKS, sum(iweight1))
109probKS
110+0.592453480E-1
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.210479677
114probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
115probKS
116+0.945179105
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.611972570, +0.661492288, +0.283098519, +0.871342480, +0.266463399, +0.518711269, +0.691151857, +0.214590907
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.214590907
125probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
126probKS
127+0.805730641
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+1, +4, +7, +7, +3, +1, +6, +9
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.216901481
136probKS = getProbKS(statKS, sum(iweight1))
137probKS
138+0.476403236E-1
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.216901481
142probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
143probKS
144+0.906270444
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.412885129, +0.666892529, +0.890827835
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.412885129
153probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
154probKS
155+0.559007168
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+7, +6, +3
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.412885129
164probKS = getProbKS(statKS, sum(iweight1))
165probKS
166+0.567454100E-2
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.412885129
170probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
171probKS
172+0.612976432
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.748530746, +0.847966194, +0.182071030, +0.921644092, +0.550287366
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.350287378
181probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
182probKS
183+0.476733029
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+8, +4, +5, +7, +2
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.479299963
192probKS = getProbKS(statKS, sum(iweight1))
193probKS
194+0.661611557E-5
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.479299963
198probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
199probKS
200+0.198580623
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.973555446, +0.270028114, +0.440104485, +0.126195967, +0.965398848, +0.572558343, +0.995203555, +0.682451844
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.340398848
209probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
210probKS
211+0.252343655
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+1, +9, +3, +3, +5, +7, +2, +9
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.193105042
220probKS = getProbKS(statKS, sum(iweight1))
221probKS
222+0.958331823E-1
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.193105042
226probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
227probKS
228+0.964010775
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.660184443, +0.403744042, +0.866553605, +0.448995292, +0.596399307, +0.745425522, +0.661064982, +0.442012906, +0.948382437, +0.588714361
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.403744042
237probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
238probKS
239+0.553529859E-1
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+9, +9, +6, +4, +2, +7, +2, +5, +9, +6
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.403744042
248probKS = getProbKS(statKS, sum(iweight1))
249probKS
250+0.00000000
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.403744042
254probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
255probKS
256+0.942468047E-1
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.602278173, +0.325556159, +0.434645295
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.397721827
265probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
266probKS
267+0.607242107
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+1, +6, +7
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.493926167
276probKS = getProbKS(statKS, sum(iweight1))
277probKS
278+0.123804808E-2
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.493926167
282probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
283probKS
284+0.479214966
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.680385292, +1.06130874, -1.05992270, +0.206461400, +1.09774375
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.381784737
298probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
299probKS
300+0.367974877
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+6, +7, +1, +6, +8
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.546070457
309probKS = getProbKS(statKS, sum(iweight1))
310probKS
311+0.596046448E-7
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.546070457
315probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
316probKS
317+0.103952110
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322-1.17966509, +1.33958066, +0.285816044, -2.86359000, +0.469453603, +1.11978781, -0.927450478
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.251725107
326probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
327probKS
328+0.700096905
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+4, +6, +8, +5, +6, +9, +2
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.337490469
337probKS = getProbKS(statKS, sum(iweight1))
338probKS
339+0.147879124E-3
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.337490469
343probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
344probKS
345+0.407347202
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350+1.58451307, -0.373223066, -0.614647388, -0.849718004E-1, +0.542600632
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.269393802
354probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
355probKS
356+0.795161545
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+8, +2, +6, +7, +3
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.269393802
365probKS = getProbKS(statKS, sum(iweight1))
366probKS
367+0.371377468E-1
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.269393802
371probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
372probKS
373+0.868048489
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378+0.128500499E-1, -0.556562662, -0.123393029, -0.125062624E-1, -1.57089305, +0.873300016
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.328207076
382probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
383probKS
384+0.453152001
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+8, +5, +3, +1, +1, +7
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.248913139
393probKS = getProbKS(statKS, sum(iweight1))
394probKS
395+0.755279660E-1
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.248913139
399probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
400probKS
401+0.919738948
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406-1.86525989, +0.162649155, +1.14998841, +1.49993563, +0.438667208, -0.336715341, -0.559750676, -0.562392473, -0.808587253, -1.53268886
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.231834292
410probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
411probKS
412+0.595282495
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+4, +7, +7, +4, +3, +7, +5, +6, +3, +5
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.220069587
421probKS = getProbKS(statKS, sum(iweight1))
422probKS
423+0.118446946E-1
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.220069587
427probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
428probKS
429+0.708629847
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434+0.634779692, -0.337696642, +0.101046368, +0.282361150, -0.940403759, +0.265650421, +0.499229645E-2
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.262786031
438probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
439probKS
440+0.647854269
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+1, +6, +3, +7, +7, +5, +1
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.355500042
449probKS = getProbKS(statKS, sum(iweight1))
450probKS
451+0.687479973E-3
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.355500042
455probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
456probKS
457+0.424355507
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462-1.01495504, -0.971003354, +0.576281488, +0.493916184, +2.62294531, +0.699197650, +0.397261202, -1.45296216
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.279412568
466probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
467probKS
468+0.488859951
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+8, +5, +8, +6, +2, +6, +8, +2
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.321079224
477probKS = getProbKS(statKS, sum(iweight1))
478probKS
479+0.127673149E-3
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.321079224
483probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
484probKS
485+0.406055987
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490-0.521996617, -0.218877383E-1, +0.680643320, -0.454270273, +1.23284388, +1.27680838, -2.36960268, +1.23671365, +1.67219639
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.335627437
494probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
495probKS
496+0.211618602
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+3, +3, +2, +1, +6, +8, +2, +2, +8
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.576897264
505probKS = getProbKS(statKS, sum(iweight1))
506probKS
507+0.00000000
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.576897264
511probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
512probKS
513+0.173697472E-1
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518+0.281620681, +0.343992114, -0.586772561, -1.00303471, +0.218603581, -1.69188166
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.365426123
522probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
523probKS
524+0.320938528
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+5, +9, +3, +1, +1, +2
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.365426123
533probKS = getProbKS(statKS, sum(iweight1))
534probKS
535+0.512617826E-2
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.365426123
539probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
540probKS
541+0.606104970
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546+0.420961350, +0.185761973, +0.450357907E-1, +0.319852233, -1.46804130, -0.434015602, +0.535362959
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.296199441
550probKS = getProbKS(statKS, nsam1) ! assuming unweighted samples.
551probKS
552+0.493797898
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+6, +5, +9, +7, +3, +4, +4
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.333750069
561probKS = getProbKS(statKS, sum(iweight1))
562probKS
563+0.287234783E-3
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.333750069
567probKS = getProbKS(statKS, sum(rweight1), sum(rweight1**2))
568probKS
569+0.410343051
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.918609083, +0.175046325, +0.473087370, +0.242241025E-1, +0.404218793, +0.510570526, +0.750517607, +0.333082676E-2
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.140347481E-1, +0.928643167, +0.249650657, +0.414809823
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.250000000
586probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
587probKS
588+0.985745251
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+6, +2, +6, +1, +1, +7, +1, +5
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.439655185
597probKS = getProbKS(statKS, sum(iweight1), nsam2)
598probKS
599+0.388805866
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.439655185
603probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
604probKS
605+0.621254623
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+8, +7, +7, +5
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.430395961
614probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
615probKS
616+0.737816095E-2
617probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618probKS
619+0.276947320
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.430395961
623probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624probKS
625+0.655836701
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.964345694, +0.455367208, +0.454771280
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.757391095
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+0.666666687
637probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
638probKS
639+0.640599132
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+4, +8, +9
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+0.809523821
648probKS = getProbKS(statKS, sum(iweight1), nsam2)
649probKS
650+0.292969584
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+0.809523821
654probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
655probKS
656+0.400996327
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+7
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+0.809523821
665probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
666probKS
667+0.721693039E-3
668probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669probKS
670+0.693528056E-1
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+0.809523821
674probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675probKS
676+0.400996327
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.677905142, +0.123868823, +0.968774855, +0.474617839, +0.152571082, +0.811890304, +0.416277945
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.440616727, +0.150049627, +0.728440046
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+0.285714269
688probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
689probKS
690+0.979972422
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+2, +3, +1, +8, +4, +5, +4
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+0.259259284
699probKS = getProbKS(statKS, sum(iweight1), nsam2)
700probKS
701+0.977975070
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+0.259259284
705probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
706probKS
707+0.995799720
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+2, +3, +2
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+0.317460358
716probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
717probKS
718+0.541886270
719probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720probKS
721+0.847491741
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+0.317460358
725probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726probKS
727+0.964730918
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.348249674E-1, +0.678867698, +0.971817613, +0.770888627, +0.552349925, +0.387537420, +0.953372598, +0.138764381E-1, +0.356970549
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.866714239, +0.792740583E-1, +0.926134109, +0.905420780E-1, +0.383863330
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.266666681
739probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
740probKS
741+0.944468737
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+4, +6, +1, +8, +9, +9, +3, +8, +7
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.327272654
750probKS = getProbKS(statKS, sum(iweight1), nsam2)
751probKS
752+0.615837097
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.327272654
756probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
757probKS
758+0.825851440
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+2, +4, +6, +3, +6
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.308225036
767probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
768probKS
769+0.890756845E-1
770probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771probKS
772+0.581132889
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.308225036
776probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777probKS
778+0.901395559
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.909213722, +0.135219395, +0.868196726, +0.901540220, +0.256987274, +0.681144714, +0.737713516, +0.835244656
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.889343023E-2, +0.185074627, +0.998635352, +0.985233128, +0.933409154
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+0.600000024
790probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
791probKS
792+0.134245157
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+9, +3, +4, +8, +6, +7, +5, +8
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+0.599999905
801probKS = getProbKS(statKS, sum(iweight1), nsam2)
802probKS
803+0.438228846E-1
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+0.599999905
807probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
808probKS
809+0.146592021
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+9, +6, +1, +6, +6
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+0.475714326
818probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
819probKS
820+0.335454941E-3
821probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822probKS
823+0.101123691
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+0.475714326
827probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828probKS
829+0.448606193
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.395591557, +0.530764639, +0.202414036
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.211610913, +0.128943264, +0.532164216, +0.403368592, +0.951641977, +0.401474893, +0.589747608, +0.336771011, +0.399106860
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.333333343
841probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
842probKS
843+0.907581985
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+1, +4, +9
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.531746089
852probKS = getProbKS(statKS, sum(iweight1), nsam2)
853probKS
854+0.571129918E-1
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.531746089
858probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
859probKS
860+0.560911417
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+8, +9, +3, +4, +1, +6, +2, +5, +4
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.428571463
869probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
870probKS
871+0.290364623E-1
872probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873probKS
874+0.747957945
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.428571463
878probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879probKS
880+0.831362724
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.180443525, +0.364023328, +0.170207798
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.788386047, +0.967619956, +0.626059949, +0.426645577
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+1.00000000
892probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
893probKS
894+0.205039978E-1
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+1, +2, +2
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+1.00000000
903probKS = getProbKS(statKS, sum(iweight1), nsam2)
904probKS
905+0.686067343E-2
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+1.00000000
909probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
910probKS
911+0.241150260E-1
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+8, +8, +1, +7
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+1.00000000
920probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
921probKS
922+0.116229057E-3
923probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924probKS
925+0.386631489E-2
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+1.00000000
929probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930probKS
931+0.329986811E-1
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.236142457, +0.397683144, +0.580960214, +0.701507449, +0.480057001, +0.555683672, +0.111082137, +0.977445781, +0.707425237
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.348372102, +0.577573121, +0.531984627
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+0.444444418
943probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
944probKS
945+0.622804284
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+4, +2, +5, +5, +1, +5, +2, +7, +9
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+0.649999976
954probKS = getProbKS(statKS, sum(iweight1), nsam2)
955probKS
956+0.108715296
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+0.649999976
960probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
961probKS
962+0.203710318
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+1, +9, +8
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+0.649999976
971probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
972probKS
973+0.221729279E-4
974probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975probKS
976+0.148329735E-1
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+0.649999976
980probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981probKS
982+0.296348810
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.838498235, +0.392711699, +0.562042117
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.841958284, +0.854712307
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+1.00000000
994probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
995probKS
996+0.626705289E-1
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+2, +2, +2
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+1.00000000
1005probKS = getProbKS(statKS, sum(iweight1), nsam2)
1006probKS
1007+0.326216221E-1
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+1.00000000
1011probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012probKS
1013+0.626705289E-1
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+9, +5
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+1.00000000
1022probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1023probKS
1024+0.101983547E-3
1025probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026probKS
1027+0.402718782E-2
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+1.00000000
1031probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032probKS
1033+0.708248019E-1
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.844324172, +0.180904210, +0.193701684, +0.103821874, +0.237490118, +0.282863975E-1, +0.613570452, +0.142697513, +0.266947806
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.893250287, +0.429074585, +0.950456500, +0.804113150
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+0.777777791
1045probKS = getProbKS(statKS, nsam1, nsam2) ! assuming unweighted samples.
1046probKS
1047+0.317912102E-1
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+6, +5, +5, +6, +1, +3, +3, +9, +5
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+0.790697694
1056probKS = getProbKS(statKS, sum(iweight1), nsam2)
1057probKS
1058+0.846868753E-2
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+0.790697694
1062probKS = getProbKS(statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063probKS
1064+0.343716145E-1
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+7, +5, +2, +8
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+0.790697694
1073probKS = getProbKS(statKS, sum(iweight1), sum(iweight2))
1074probKS
1075+0.00000000
1076probKS = getProbKS(statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077probKS
1078+0.668942928E-3
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+0.790697694
1082probKS = getProbKS(statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083probKS
1084+0.490074158E-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: