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

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

Detailed Description

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

See pm_statest for the mathematical definition of the KS test.

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


Possible calling interfaces

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


Example usage

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

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Compute the KS probability of sample originating from a Uniform distribution in range `[0, 1)`.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6nsam1 = getUnifRand(1, 10)
7sample1 = getUnifRand(0., 1., nsam1)
8sample1
9+0.203030109, +0.641373158, +0.205537736, +0.731497705, +0.163228095
10statKS = getDisKolm(sample1) ! assuming unweighted samples.
11statKS
12+0.394462287
13call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
14[probKS, quanKS]
15+0.328979611, +0.948784888
16
17iweight1 = getUnifRand(1, 9, nsam1)
18iweight1
19+4, +4, +3, +6, +2
20rweight1 = iweight1
21statKS = getDisKolm(sample1, iweight1, sum(iweight1))
22statKS
23+0.268502295
24call setProbKS(probKS, quanKS, statKS, sum(iweight1))
25[probKS, quanKS]
26+0.107296288, +1.20937049
27statKS = getDisKolm(sample1, rweight1, sum(rweight1))
28statKS
29+0.268502295
30call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
31[probKS, quanKS]
32+0.846547425, +0.613048792
33
34nsam1 = getUnifRand(1, 10)
35sample1 = getUnifRand(0., 1., nsam1)
36sample1
37+0.682456672, +0.478744507E-1, +0.288029611, +0.375700414, +0.901460648E-3
38statKS = getDisKolm(sample1) ! assuming unweighted samples.
39statKS
40+0.424299598
41call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
42[probKS, quanKS]
43+0.248618126, +1.02055144
44
45iweight1 = getUnifRand(1, 9, nsam1)
46iweight1
47+5, +4, +9, +6, +4
48rweight1 = iweight1
49statKS = getDisKolm(sample1, iweight1, sum(iweight1))
50statKS
51+0.445728242
52call setProbKS(probKS, quanKS, statKS, sum(iweight1))
53[probKS, quanKS]
54+0.161528587E-4, +2.42132521
55statKS = getDisKolm(sample1, rweight1, sum(rweight1))
56statKS
57+0.445728242
58call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
59[probKS, quanKS]
60+0.246435523, +1.02272165
61
62nsam1 = getUnifRand(1, 10)
63sample1 = getUnifRand(0., 1., nsam1)
64sample1
65+0.832525790, +0.135855794, +0.946642458, +0.782246590E-1
66statKS = getDisKolm(sample1) ! assuming unweighted samples.
67statKS
68+0.364144206
69call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
70[probKS, quanKS]
71+0.557189465, +0.792013645
72
73iweight1 = getUnifRand(1, 9, nsam1)
74iweight1
75+4, +5, +7, +9
76rweight1 = iweight1
77statKS = getDisKolm(sample1, iweight1, sum(iweight1))
78statKS
79+0.424144149
80call setProbKS(probKS, quanKS, statKS, sum(iweight1))
81[probKS, quanKS]
82+0.147759914E-3, +2.18094921
83statKS = getDisKolm(sample1, rweight1, sum(rweight1))
84statKS
85+0.424144149
86call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
87[probKS, quanKS]
88+0.412093282, +0.886179388
89
90nsam1 = getUnifRand(1, 10)
91sample1 = getUnifRand(0., 1., nsam1)
92sample1
93+0.944220364, +0.763934255E-1
94statKS = getDisKolm(sample1) ! assuming unweighted samples.
95statKS
96+0.444220364
97call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
98[probKS, quanKS]
99+0.684325099, +0.716081142
100
101iweight1 = getUnifRand(1, 9, nsam1)
102iweight1
103+5, +3
104rweight1 = iweight1
105statKS = getDisKolm(sample1, iweight1, sum(iweight1))
106statKS
107+0.569220364
108call setProbKS(probKS, quanKS, statKS, sum(iweight1))
109[probKS, quanKS]
110+0.615888834E-2, +1.70044208
111statKS = getDisKolm(sample1, rweight1, sum(rweight1))
112statKS
113+0.569220364
114call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
115[probKS, quanKS]
116+0.399799585, +0.894908011
117
118nsam1 = getUnifRand(1, 10)
119sample1 = getUnifRand(0., 1., nsam1)
120sample1
121+0.405632257, +0.624966621, +0.539201975, +0.344439685, +0.542382598, +0.203894913, +0.449537039, +0.972304344E-1, +0.709795713, +0.159487426
122statKS = getDisKolm(sample1) ! assuming unweighted samples.
123statKS
124+0.290204287
125call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
126[probKS, quanKS]
127+0.312233090, +0.962625802
128
129iweight1 = getUnifRand(1, 9, nsam1)
130iweight1
131+5, +7, +6, +7, +3, +9, +7, +2, +7, +2
132rweight1 = iweight1
133statKS = getDisKolm(sample1, iweight1, sum(iweight1))
134statKS
135+0.290204287
136call setProbKS(probKS, quanKS, statKS, sum(iweight1))
137[probKS, quanKS]
138+0.134944916E-3, +2.19134140
139statKS = getDisKolm(sample1, rweight1, sum(rweight1))
140statKS
141+0.290204287
142call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
143[probKS, quanKS]
144+0.402615905, +0.892894626
145
146nsam1 = getUnifRand(1, 10)
147sample1 = getUnifRand(0., 1., nsam1)
148sample1
149+0.897032499, +0.134232879, +0.987594426, +0.567355573, +0.534966528
150statKS = getDisKolm(sample1) ! assuming unweighted samples.
151statKS
152+0.334966540
153call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
154[probKS, quanKS]
155+0.534925818, +0.805682063
156
157iweight1 = getUnifRand(1, 9, nsam1)
158iweight1
159+9, +6, +1, +3, +8
160rweight1 = iweight1
161statKS = getDisKolm(sample1, iweight1, sum(iweight1))
162statKS
163+0.312744319
164call setProbKS(probKS, quanKS, statKS, sum(iweight1))
165[probKS, quanKS]
166+0.760138035E-2, +1.66921711
167statKS = getDisKolm(sample1, rweight1, sum(rweight1))
168statKS
169+0.312744319
170call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
171[probKS, quanKS]
172+0.766618252, +0.666131735
173
174nsam1 = getUnifRand(1, 10)
175sample1 = getUnifRand(0., 1., nsam1)
176sample1
177+0.610787988, +0.509104133E-1
178statKS = getDisKolm(sample1) ! assuming unweighted samples.
179statKS
180+0.449089587
181call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
182[probKS, quanKS]
183+0.671117425, +0.723930299
184
185iweight1 = getUnifRand(1, 9, nsam1)
186iweight1
187+5, +4
188rweight1 = iweight1
189statKS = getDisKolm(sample1, iweight1, sum(iweight1))
190statKS
191+0.393534034
192call setProbKS(probKS, quanKS, statKS, sum(iweight1))
193[probKS, quanKS]
194+0.913235545E-1, +1.24225569
195statKS = getDisKolm(sample1, rweight1, sum(rweight1))
196statKS
197+0.393534034
198call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
199[probKS, quanKS]
200+0.820538759, +0.631159425
201
202nsam1 = getUnifRand(1, 10)
203sample1 = getUnifRand(0., 1., nsam1)
204sample1
205+0.180020332, +0.318874121, +0.306072235, +0.246218085, +0.597390354, +0.673498034, +0.972510934, +0.211614966E-1, +0.642313540, +0.572485328
206statKS = getDisKolm(sample1) ! assuming unweighted samples.
207statKS
208+0.226502001
209call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
210[probKS, quanKS]
211+0.624943018, +0.751321316
212
213iweight1 = getUnifRand(1, 9, nsam1)
214iweight1
215+1, +2, +8, +1, +1, +4, +5, +6, +6, +8
216rweight1 = iweight1
217statKS = getDisKolm(sample1, iweight1, sum(iweight1))
218statKS
219+0.207454383
220call setProbKS(probKS, quanKS, statKS, sum(iweight1))
221[probKS, quanKS]
222+0.461236238E-1, +1.37287378
223statKS = getDisKolm(sample1, rweight1, sum(rweight1))
224statKS
225+0.207454383
226call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
227[probKS, quanKS]
228+0.881347835, +0.586732328
229
230nsam1 = getUnifRand(1, 10)
231sample1 = getUnifRand(0., 1., nsam1)
232sample1
233+0.296568871E-2, +0.927554488
234statKS = getDisKolm(sample1) ! assuming unweighted samples.
235statKS
236+0.497034311
237call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
238[probKS, quanKS]
239+0.542163670, +0.801217020
240
241iweight1 = getUnifRand(1, 9, nsam1)
242iweight1
243+3, +4
244rweight1 = iweight1
245statKS = getDisKolm(sample1, iweight1, sum(iweight1))
246statKS
247+0.498983026
248call setProbKS(probKS, quanKS, statKS, sum(iweight1))
249[probKS, quanKS]
250+0.395025611E-1, +1.40080869
251statKS = getDisKolm(sample1, rweight1, sum(rweight1))
252statKS
253+0.498983026
254call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
255[probKS, quanKS]
256+0.547954321, +0.797659993
257
258nsam1 = getUnifRand(1, 10)
259sample1 = getUnifRand(0., 1., nsam1)
260sample1
261+0.279667258, +0.642632544, +0.273894668E-1, +0.171967864, +0.447345734, +0.561631978, +0.896118164, +0.216700613
262statKS = getDisKolm(sample1) ! assuming unweighted samples.
263statKS
264+0.232367456
265call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
266[probKS, quanKS]
267+0.720941603, +0.694155455
268
269iweight1 = getUnifRand(1, 9, nsam1)
270iweight1
271+8, +6, +3, +3, +1, +4, +4, +8
272rweight1 = iweight1
273statKS = getDisKolm(sample1, iweight1, sum(iweight1))
274statKS
275+0.314927340
276call setProbKS(probKS, quanKS, statKS, sum(iweight1))
277[probKS, quanKS]
278+0.927388668E-3, +1.95911467
279statKS = getDisKolm(sample1, rweight1, sum(rweight1))
280statKS
281+0.314927340
282call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
283[probKS, quanKS]
284+0.471109271, +0.846200764
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.392691314, -0.981695205E-1, -0.730077684, +0.165299803, -0.646332622, +0.637657270E-1, +0.153356731, -0.123063497, +1.11554623
295statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
296statKS
297+0.323242903
298call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
299[probKS, quanKS]
300+0.248801291, +1.02037001
301
302iweight1 = getUnifRand(1, 9, nsam1)
303iweight1
304+7, +8, +6, +7, +6, +6, +8, +6, +6
305rweight1 = iweight1
306statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
307statKS
308+0.334354043
309call setProbKS(probKS, quanKS, statKS, sum(iweight1))
310[probKS, quanKS]
311+0.184774399E-5, +2.63476610
312statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
313statKS
314+0.334354043
315call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
316[probKS, quanKS]
317+0.221964359, +1.04809642
318
319nsam1 = getUnifRand(5, 10)
320sample1 = getNormRand(mean = getFilled(0., nsam1))
321sample1
322+0.975554168, +1.60844648, +1.93492508, -2.42087150, -0.724315464
323statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
324statKS
325+0.435357302
326call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
327[probKS, quanKS]
328+0.222844481, +1.04714811
329
330iweight1 = getUnifRand(1, 9, nsam1)
331iweight1
332+1, +6, +7, +4, +6
333rweight1 = iweight1
334statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
335statKS
336+0.487797946
337call setProbKS(probKS, quanKS, statKS, sum(iweight1))
338[probKS, quanKS]
339+0.111460686E-4, +2.45920086
340statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
341statKS
342+0.487797946
343call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
344[probKS, quanKS]
345+0.192721426, +1.08137858
346
347nsam1 = getUnifRand(5, 10)
348sample1 = getNormRand(mean = getFilled(0., nsam1))
349sample1
350-0.707451165, -0.400844477E-1, -0.820323765, +0.856934190, +0.168776348, -0.649737239
351statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
352statKS
353+0.266319633
354call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
355[probKS, quanKS]
356+0.717443228, +0.696265280
357
358iweight1 = getUnifRand(1, 9, nsam1)
359iweight1
360+1, +5, +1, +5, +3, +8
361rweight1 = iweight1
362statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
363statKS
364+0.215595007
365call setProbKS(probKS, quanKS, statKS, sum(iweight1))
366[probKS, quanKS]
367+0.206914246, +1.06477380
368statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
369statKS
370+0.215595007
371call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
372[probKS, quanKS]
373+0.974857330, +0.480917752
374
375nsam1 = getUnifRand(5, 10)
376sample1 = getNormRand(mean = getFilled(0., nsam1))
377sample1
378-0.614290178, -0.239296019, -1.74087512, +0.488004059, -0.525458232E-1
379statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
380statKS
381+0.320953131
382call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
383[probKS, quanKS]
384+0.590333045, +0.771976113
385
386iweight1 = getUnifRand(1, 9, nsam1)
387iweight1
388+1, +2, +4, +7, +3
389rweight1 = iweight1
390statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
391statKS
392+0.312773466
393call setProbKS(probKS, quanKS, statKS, sum(iweight1))
394[probKS, quanKS]
395+0.564802885E-1, +1.33547533
396statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
397statKS
398+0.312773466
399call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
400[probKS, quanKS]
401+0.786186516, +0.653747022
402
403nsam1 = getUnifRand(5, 10)
404sample1 = getNormRand(mean = getFilled(0., nsam1))
405sample1
406-0.773658514, +0.160499141, +0.289900899, -0.862072289, +1.74731541, +0.530319870, +0.447142661, -0.497536182, +0.557672560, -2.20405555
407statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
408statKS
409+0.188534021
410call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
411[probKS, quanKS]
412+0.829003096, +0.625379145
413
414iweight1 = getUnifRand(1, 9, nsam1)
415iweight1
416+7, +3, +7, +6, +8, +6, +4, +8, +7, +7
417rweight1 = iweight1
418statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
419statKS
420+0.161549866
421call setProbKS(probKS, quanKS, statKS, sum(iweight1))
422[probKS, quanKS]
423+0.667278171E-1, +1.30388713
424statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
425statKS
426+0.161549866
427call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
428[probKS, quanKS]
429+0.948744595, +0.521201491
430
431nsam1 = getUnifRand(5, 10)
432sample1 = getNormRand(mean = getFilled(0., nsam1))
433sample1
434-1.66792583, -0.295180291, +0.609067619, -0.677218497, -0.448818028, +1.96987820, +0.833300412, -0.180877954, -0.520074069
435statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
436statKS
437+0.238435000
438call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
439[probKS, quanKS]
440+0.622691154, +0.752659798
441
442iweight1 = getUnifRand(1, 9, nsam1)
443iweight1
444+1, +7, +5, +2, +8, +1, +6, +8, +9
445rweight1 = iweight1
446statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
447statKS
448+0.316449136
449call setProbKS(probKS, quanKS, statKS, sum(iweight1))
450[probKS, quanKS]
451+0.111937523E-3, +2.21251726
452statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
453statKS
454+0.316449136
455call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
456[probKS, quanKS]
457+0.426217198, +0.876337409
458
459nsam1 = getUnifRand(5, 10)
460sample1 = getNormRand(mean = getFilled(0., nsam1))
461sample1
462-0.438886225, +0.607452929, +1.35194397, -0.286789656, -0.132875949
463statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
464statKS
465+0.330371976
466call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
467[probKS, quanKS]
468+0.552902341, +0.794630945
469
470iweight1 = getUnifRand(1, 9, nsam1)
471iweight1
472+2, +1, +1, +8, +9
473rweight1 = iweight1
474statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
475statKS
476+0.457616150
477call setProbKS(probKS, quanKS, statKS, sum(iweight1))
478[probKS, quanKS]
479+0.172734261E-3, +2.16295910
480statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
481statKS
482+0.457616150
483call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
484[probKS, quanKS]
485+0.440730393, +0.866414964
486
487nsam1 = getUnifRand(5, 10)
488sample1 = getNormRand(mean = getFilled(0., nsam1))
489sample1
490+0.125861421, +0.450504363, +0.932299674, +1.17400992, +0.491232216
491statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
492statKS
493+0.550079167
494call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
495[probKS, quanKS]
496+0.603265166E-1, +1.32308412
497
498iweight1 = getUnifRand(1, 9, nsam1)
499iweight1
500+4, +6, +3, +9, +1
501rweight1 = iweight1
502statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
503statKS
504+0.550079167
505call setProbKS(probKS, quanKS, statKS, sum(iweight1))
506[probKS, quanKS]
507+0.774860382E-6, +2.71671367
508statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
509statKS
510+0.550079167
511call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
512[probKS, quanKS]
513+0.138429165, +1.15546787
514
515nsam1 = getUnifRand(5, 10)
516sample1 = getNormRand(mean = getFilled(0., nsam1))
517sample1
518+0.178229481, -1.04232657, +0.130884767, -0.901564479, +0.587696657E-1
519statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
520statKS
521+0.429271400
522call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
523[probKS, quanKS]
524+0.236767888, +1.03250992
525
526iweight1 = getUnifRand(1, 9, nsam1)
527iweight1
528+3, +5, +8, +4, +4
529rweight1 = iweight1
530statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
531statKS
532+0.429271400
533call setProbKS(probKS, quanKS, statKS, sum(iweight1))
534[probKS, quanKS]
535+0.171005726E-3, +2.16414309
536statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
537statKS
538+0.429271400
539call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
540[probKS, quanKS]
541+0.294862688, +0.977535605
542
543nsam1 = getUnifRand(5, 10)
544sample1 = getNormRand(mean = getFilled(0., nsam1))
545sample1
546-0.430932611, +0.120028920, -0.611642003, +0.434246629, -0.149966434, -0.594306707
547statKS = getDisKolm(sample1, getNormCDF_RKS) ! assuming unweighted samples.
548statKS
549+0.332054675
550call setProbKS(probKS, quanKS, statKS, nsam1) ! assuming unweighted samples.
551[probKS, quanKS]
552+0.438213170, +0.868122756
553
554iweight1 = getUnifRand(1, 9, nsam1)
555iweight1
556+4, +9, +1, +6, +1, +3
557rweight1 = iweight1
558statKS = getDisKolm(sample1, iweight1, sum(iweight1), getNormCDF_RKS)
559statKS
560+0.332054675
561call setProbKS(probKS, quanKS, statKS, sum(iweight1))
562[probKS, quanKS]
563+0.736057758E-2, +1.67403150
564statKS = getDisKolm(sample1, rweight1, sum(rweight1), getNormCDF_RKS)
565statKS
566+0.332054675
567call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight1**2))
568[probKS, quanKS]
569+0.673999786, +0.722218931
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.353881717, +0.549148619, +0.814085484, +0.342118919
580sample2 = getUnifRand(0., 1., nsam2)
581sample2
582+0.966167450E-1, +0.418221593, +0.310454369, +0.143491149, +0.200273991, +0.994065523, +0.173179626, +0.617039740, +0.273689747
583statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
584statKS
585+0.666666687
586call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
587[probKS, quanKS]
588+0.953835845E-1, +1.23346829
589
590iweight1 = getUnifRand(1, 9, nsam1)
591iweight1
592+6, +1, +4, +1
593rweight1 = iweight1
594statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
595statKS
596+0.666666687
597call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
598[probKS, quanKS]
599+0.102254748E-1, +1.62419486
600statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
601statKS
602+0.666666687
603call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
604[probKS, quanKS]
605+0.187837362, +1.08731210
606
607iweight2 = getUnifRand(1, 9, nsam2)
608iweight2
609+2, +7, +3, +5, +6, +5, +7, +8, +7
610rweight2 = iweight2
611statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
612statKS
613+0.599999964
614call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
615[probKS, quanKS]
616+0.922977924E-3, +1.95972896
617call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
618[probKS, quanKS]
619+0.203965902, +1.06814909
620statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
621statKS
622+0.599999964
623call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
624[probKS, quanKS]
625+0.305891573, +0.968000233
626
627nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
628sample1 = getUnifRand(0., 1., nsam1)
629sample1
630+0.844657838, +0.735962570, +0.884872198, +0.698993862, +0.885897815, +0.731908679, +0.963922083, +0.901706517, +0.979204834
631sample2 = getUnifRand(0., 1., nsam2)
632sample2
633+0.851076305, +0.826614678, +0.232144594, +0.123154879, +0.694765568, +0.588098526, +0.448798299, +0.378759682, +0.544264019
634statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
635statKS
636+0.777777791
637call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
638[probKS, quanKS]
639+0.345075130E-2, +1.78358042
640
641iweight1 = getUnifRand(1, 9, nsam1)
642iweight1
643+3, +7, +4, +5, +4, +1, +9, +2, +9
644rweight1 = iweight1
645statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
646statKS
647+0.777777791
648call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
649[probKS, quanKS]
650+0.796914101E-4, +2.25064230
651statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
652statKS
653+0.777777791
654call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
655[probKS, quanKS]
656+0.748175383E-2, +1.67159152
657
658iweight2 = getUnifRand(1, 9, nsam2)
659iweight2
660+1, +3, +5, +8, +7, +2, +1, +9, +8
661rweight2 = iweight2
662statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
663statKS
664+0.909090877
665call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
666[probKS, quanKS]
667+0.00000000, +4.39442539
668call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
669[probKS, quanKS]
670+0.275969505E-4, +2.36552072
671statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
672statKS
673+0.909090877
674call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
675[probKS, quanKS]
676+0.256407261E-2, +1.82473505
677
678nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
679sample1 = getUnifRand(0., 1., nsam1)
680sample1
681+0.379793465, +0.812241614, +0.256040931, +0.144738615, +0.328287482E-1, +0.849261522, +0.796898484, +0.116947114, +0.459864974, +0.398342073
682sample2 = getUnifRand(0., 1., nsam2)
683sample2
684+0.869061410
685statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
686statKS
687+1.00000000
688call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
689[probKS, quanKS]
690+0.118398249, +1.18883157
691
692iweight1 = getUnifRand(1, 9, nsam1)
693iweight1
694+4, +5, +3, +1, +1, +4, +8, +7, +6, +1
695rweight1 = iweight1
696statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
697statKS
698+1.00000000
699call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
700[probKS, quanKS]
701+0.102347910, +1.21909606
702statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
703statKS
704+1.00000000
705call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
706[probKS, quanKS]
707+0.126165390, +1.17538452
708
709iweight2 = getUnifRand(1, 9, nsam2)
710iweight2
711+3
712rweight2 = iweight2
713statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
714statKS
715+1.00000000
716call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
717[probKS, quanKS]
718+0.203108788E-2, +1.85638511
719call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
720[probKS, quanKS]
721+0.837290287E-2, +1.65467572
722statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
723statKS
724+1.00000000
725call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
726[probKS, quanKS]
727+0.126165390, +1.17538452
728
729nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
730sample1 = getUnifRand(0., 1., nsam1)
731sample1
732+0.282666266, +0.191975117, +0.651987314, +0.157700896, +0.197813511E-1, +0.118347228, +0.544796288, +0.972208917
733sample2 = getUnifRand(0., 1., nsam2)
734sample2
735+0.970036328, +0.266996980, +0.781308711, +0.437777638, +0.752282739, +0.591979980
736statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
737statKS
738+0.500000000
739call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
740[probKS, quanKS]
741+0.253729820, +1.01552355
742
743iweight1 = getUnifRand(1, 9, nsam1)
744iweight1
745+4, +7, +5, +9, +2, +2, +4, +3
746rweight1 = iweight1
747statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
748statKS
749+0.555555582
750call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
751[probKS, quanKS]
752+0.512637496E-1, +1.35349572
753statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
754statKS
755+0.555555582
756call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
757[probKS, quanKS]
758+0.196088552, +1.07735574
759
760iweight2 = getUnifRand(1, 9, nsam2)
761iweight2
762+5, +2, +9, +6, +1, +9
763rweight2 = iweight2
764statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
765statKS
766+0.604166687
767call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
768[probKS, quanKS]
769+0.345706940E-5, +2.57537627
770call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
771[probKS, quanKS]
772+0.232598186E-1, +1.49234259
773statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
774statKS
775+0.604166687
776call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
777[probKS, quanKS]
778+0.182865977, +1.09347677
779
780nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
781sample1 = getUnifRand(0., 1., nsam1)
782sample1
783+0.511322141
784sample2 = getUnifRand(0., 1., nsam2)
785sample2
786+0.486192226, +0.219495058
787statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
788statKS
789+1.00000000
790call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
791[probKS, quanKS]
792+0.201313019, +1.07121849
793
794iweight1 = getUnifRand(1, 9, nsam1)
795iweight1
796+7
797rweight1 = iweight1
798statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
799statKS
800+1.00000000
801call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
802[probKS, quanKS]
803+0.289170742E-1, +1.45541525
804statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
805statKS
806+1.00000000
807call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
808[probKS, quanKS]
809+0.201313019, +1.07121849
810
811iweight2 = getUnifRand(1, 9, nsam2)
812iweight2
813+8, +9
814rweight2 = iweight2
815statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
816statKS
817+1.00000000
818call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
819[probKS, quanKS]
820+0.206232071E-4, +2.39613128
821call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
822[probKS, quanKS]
823+0.109576046, +1.20501435
824statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
825statKS
826+1.00000000
827call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
828[probKS, quanKS]
829+0.201651037, +1.07082570
830
831nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
832sample1 = getUnifRand(0., 1., nsam1)
833sample1
834+0.851658583E-1, +0.520192385, +0.764067113, +0.431267858, +0.630271137, +0.745487034, +0.463114023, +0.148182452, +0.201779604E-2, +0.153291523
835sample2 = getUnifRand(0., 1., nsam2)
836sample2
837+0.637083530, +0.636703074, +0.426450431, +0.485931754
838statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
839statKS
840+0.400000006
841call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
842[probKS, quanKS]
843+0.626907468, +0.750154197
844
845iweight1 = getUnifRand(1, 9, nsam1)
846iweight1
847+6, +1, +2, +2, +3, +1, +6, +7, +8, +7
848rweight1 = iweight1
849statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
850statKS
851+0.651162803
852call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
853[probKS, quanKS]
854+0.491483212E-1, +1.36125767
855statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
856statKS
857+0.651162803
858call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
859[probKS, quanKS]
860+0.129603982, +1.16964662
861
862iweight2 = getUnifRand(1, 9, nsam2)
863iweight2
864+1, +8, +6, +8
865rweight2 = iweight2
866statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
867statKS
868+0.651162803
869call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
870[probKS, quanKS]
871+0.226497650E-5, +2.61731172
872call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
873[probKS, quanKS]
874+0.910007954E-2, +1.64204466
875statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
876statKS
877+0.651162803
878call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
879[probKS, quanKS]
880+0.179143071, +1.09817970
881
882nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
883sample1 = getUnifRand(0., 1., nsam1)
884sample1
885+0.361340523, +0.894375920, +0.824879825, +0.315386474
886sample2 = getUnifRand(0., 1., nsam2)
887sample2
888+0.905088484, +0.450432897E-1, +0.668618262, +0.639757037, +0.980680585, +0.395344317
889statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
890statKS
891+0.333333313
892call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
893[probKS, quanKS]
894+0.889526010, +0.580066025
895
896iweight1 = getUnifRand(1, 9, nsam1)
897iweight1
898+5, +4, +3, +6
899rweight1 = iweight1
900statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
901statKS
902+0.444444478
903call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
904[probKS, quanKS]
905+0.249995828, +1.01918888
906statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
907statKS
908+0.444444478
909call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
910[probKS, quanKS]
911+0.607688308, +0.761593521
912
913iweight2 = getUnifRand(1, 9, nsam2)
914iweight2
915+4, +8, +3, +3, +1, +4
916rweight2 = iweight2
917statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
918statKS
919+0.347826093
920call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
921[probKS, quanKS]
922+0.136151791, +1.15905488
923call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
924[probKS, quanKS]
925+0.729758561, +0.688819349
926statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
927statKS
928+0.347826093
929call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
930[probKS, quanKS]
931+0.902596772, +0.568898559
932
933nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
934sample1 = getUnifRand(0., 1., nsam1)
935sample1
936+0.426632166
937sample2 = getUnifRand(0., 1., nsam2)
938sample2
939+0.633410811
940statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
941statKS
942+1.00000000
943call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
944[probKS, quanKS]
945+0.289041579, +0.982670248
946
947iweight1 = getUnifRand(1, 9, nsam1)
948iweight1
949+3
950rweight1 = iweight1
951statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
952statKS
953+1.00000000
954call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
955[probKS, quanKS]
956+0.167768300, +1.11304247
957statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
958statKS
959+1.00000000
960call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
961[probKS, quanKS]
962+0.289041579, +0.982670248
963
964iweight2 = getUnifRand(1, 9, nsam2)
965iweight2
966+6
967rweight2 = iweight2
968statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
969statKS
970+1.00000000
971call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
972[probKS, quanKS]
973+0.110656619E-1, +1.61199534
974call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
975[probKS, quanKS]
976+0.132670283, +1.16463375
977statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
978statKS
979+1.00000000
980call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
981[probKS, quanKS]
982+0.289041579, +0.982670248
983
984nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
985sample1 = getUnifRand(0., 1., nsam1)
986sample1
987+0.955966115, +0.847432613, +0.900346220, +0.280714631E-1, +0.952424765, +0.409191012, +0.936661601
988sample2 = getUnifRand(0., 1., nsam2)
989sample2
990+0.474887848, +0.662188649, +0.288487136, +0.309700966, +0.503137946, +0.810715914, +0.307850122, +0.143339992, +0.143366098
991statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
992statKS
993+0.714285731
994call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
995[probKS, quanKS]
996+0.171362162E-1, +1.54267728
997
998iweight1 = getUnifRand(1, 9, nsam1)
999iweight1
1000+1, +5, +6, +6, +7, +6, +9
1001rweight1 = iweight1
1002statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1003statKS
1004+0.699999988
1005call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1006[probKS, quanKS]
1007+0.620365143E-3, +2.00977421
1008statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1009statKS
1010+0.699999988
1011call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1012[probKS, quanKS]
1013+0.287149549E-1, +1.45661974
1014
1015iweight2 = getUnifRand(1, 9, nsam2)
1016iweight2
1017+9, +8, +7, +3, +6, +1, +4, +2, +1
1018rweight2 = iweight2
1019statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1020statKS
1021+0.699999928
1022call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1023[probKS, quanKS]
1024+0.00000000, +3.25087214
1025call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1026[probKS, quanKS]
1027+0.516927242E-2, +1.72600257
1028statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1029statKS
1030+0.699999928
1031call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1032[probKS, quanKS]
1033+0.482869744E-1, +1.36450100
1034
1035nsam1 = getUnifRand(1, 10); nsam2 = getUnifRand(1, 10)
1036sample1 = getUnifRand(0., 1., nsam1)
1037sample1
1038+0.110948205, +0.812049687, +0.451585591, +0.751325905, +0.986623645, +0.809446633, +0.257319748, +0.804589391
1039sample2 = getUnifRand(0., 1., nsam2)
1040sample2
1041+0.927533746, +0.983831167, +0.336534858, +0.550582349
1042statKS = getDisKolm(sample1, sample2) ! assuming unweighted samples.
1043statKS
1044+0.375000000
1045call setProbKS(probKS, quanKS, statKS, nsam1, nsam2) ! assuming unweighted samples.
1046[probKS, quanKS]
1047+0.739918470, +0.682632804
1048
1049iweight1 = getUnifRand(1, 9, nsam1)
1050iweight1
1051+6, +6, +1, +6, +3, +8, +4, +1
1052rweight1 = iweight1
1053statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2)
1054statKS
1055+0.414285719
1056call setProbKS(probKS, quanKS, statKS, sum(iweight1), nsam2)
1057[probKS, quanKS]
1058+0.452201903, +0.858698130
1059statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2)
1060statKS
1061+0.414285719
1062call setProbKS(probKS, quanKS, statKS, sum(rweight1), nsam2, sum(rweight1**2))
1063[probKS, quanKS]
1064+0.670893669, +0.724063098
1065
1066iweight2 = getUnifRand(1, 9, nsam2)
1067iweight2
1068+3, +7, +7, +8
1069rweight2 = iweight2
1070statKS = getDisKolm(sample1, iweight1, sum(iweight1), sample2, iweight2, sum(iweight2))
1071statKS
1072+0.314285696
1073call setProbKS(probKS, quanKS, statKS, sum(iweight1), sum(iweight2))
1074[probKS, quanKS]
1075+0.892077684E-1, +1.24696553
1076call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(iweight2), sum(rweight1**2))
1077[probKS, quanKS]
1078+0.624187946, +0.751770079
1079statKS = getDisKolm(sample1, rweight1, sum(rweight1), sample2, rweight2, sum(rweight2))
1080statKS
1081+0.314285696
1082call setProbKS(probKS, quanKS, statKS, sum(rweight1), sum(rweight2), sum(rweight1**2), sum(rweight2**2))
1083[probKS, quanKS]
1084+0.935733438, +0.536488414
1085
1086
Test:
test_pm_statest
Internal naming convention:
The following illustrates the internal naming convention used for the procedures within this generic interface.
setProbKS_WIX_D0_RK5()
||| || |||
||| || |||
||| || |||
||| || |The Kind of the output.
||| The rank of the input arguments.
The sample presence and weight types: X => missing, WDD => default(unweighted) / default(unweighted), WID => integer-weighted, default, WRD => real-weighted, default., WII => integer-weighted, integer-weighted, WRR => real-weighted, real-weighted.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Monday March 6, 2017, 3:22 pm, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin.

Definition at line 680 of file pm_statest.F90.


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