@@ -16,19 +16,21 @@ KolmogorovSmirnov2sampleTest >> initialize [
16
16
KolmogorovSmirnov2sampleTest >> testRejectOfEqualityHypothesesForTwoSamples [
17
17
| nd ks |
18
18
nd := PMNormalDistribution new .
19
- ks := PMKolmogorovSmirnov2Sample compareData: ((1 to: 100 ) collect: [ :i | nd random ]) withData: ((1 to: 100 ) collect: [ :i | nd random ]). " -->
20
- a KolmogorovSmirnov2Sample(dataSize: 100 otherDataSize: 100)"
21
- ks ksStatistic. " -->(9/100)"
22
- ks pValue asFloat. " -->0.18458528753386905"
23
- self assert: (ks rejectEqualityHypothesisWithAlpha: 0.05 ) equals: false
19
+ ks := PMKolmogorovSmirnov2Sample
20
+ compareData: ((1 to: 100 ) collect: [ :i | nd random ])
21
+ withData: ((1 to: 100 ) collect: [ :i | nd random ]).
22
+ ks ksStatistic.
23
+ ks pValue asFloat.
24
+ self
25
+ assert: (ks rejectEqualityHypothesisWithAlpha: 0.05 )
26
+ equals: false
24
27
]
25
28
26
29
{ #category : #tests }
27
30
KolmogorovSmirnov2sampleTest >> testSecondSmallSample [
28
- " sample from
29
- Kim, P. J. & Jennrich, R. I.
30
- Tables of the exact sampling distribution of the two-sample Kolmogorov–Smirnov criterion
31
- in Selected Tables in Mathematical Statistics Volume I (1973)"
31
+ " sample from Kim, P. J. & Jennrich, R. I.
32
+ Tables of the exact sampling distribution of the two-sample Kolmogorov–Smirnov criterion
33
+ in Selected Tables in Mathematical Statistics Volume I (1973)"
32
34
33
35
| d1 d2 |
34
36
d1 := #(0.723 0.382 -0.854 -1.318 0.847 -0.41 -0.111) .
@@ -56,7 +58,7 @@ KolmogorovSmirnov2sampleTest >> testSmallSample [
56
58
k data: d1.
57
59
k otherData: d2.
58
60
self assert: (1 - k pValue asFloat roundTo: 0.00001 ) equals: 0.06063 .
59
- self assert: k ksStatistic equals: 5 / 9 . " 0.55555...6 "
61
+ self assert: k ksStatistic equals: 5 / 9 .
60
62
self deny: (k rejectEqualityHypothesisWithAlpha: 0.05 ).
61
63
self assert: (k rejectEqualityHypothesisWithAlpha: 0.07 )
62
64
]
0 commit comments