@@ -102,20 +102,18 @@ PMNumericalMethodsTestCase >> testErrorFunction [
102102
103103{ #category : #estimation }
104104PMNumericalMethodsTestCase >> testFTest [
105+
105106 | accC accMM confidenceLevel |
106107 accC := PMStatisticalMoments new .
107- #(5.56 5.89 4.66 5.69 5.34 4.79 4.80 7.86 3.64 5.70)
108- do: [ :x | accC accumulate: x ].
108+ #( 5.56 5.89 4.66 5.69 5.34 4.79 4.80 7.86 3.64 5.70 ) do: [ :x | accC accumulate: x ].
109109 accMM := PMStatisticalMoments new .
110- #(7.48 6.75 3.77 5.71 7.25 4.73 6.23 5.60 5.94 4.58)
111- do: [ :x | accMM accumulate: x ].
110+ #( 7.48 6.75 3.77 5.71 7.25 4.73 6.23 5.60 5.94 4.58 ) do: [ :x | accMM accumulate: x ].
112111 confidenceLevel := accC fConfidenceLevel: accMM.
113- self assert: (accC average - 5.393 ) abs < 0.000000001 .
114- self
115- assert: (accC standardDeviation - 1.0990809292 ) abs < 0.000000001 .
116- self assert: (accMM average - 5.804 ) abs < 0.000000001 .
117- self assert: (accMM standardDeviation - 1.19415428 ) abs < 0.000000001 .
118- self assert: (confidenceLevel - 79.8147614536 ) abs < 0.000000001
112+ self assert: accC average - 5.393 closeTo: 0 .
113+ self assert: accC standardDeviation - 1.0990809292 closeTo: 0 .
114+ self assert: accMM average - 5.804 closeTo: 0 .
115+ self assert: accMM standardDeviation - 1.19415428 closeTo: 0 .
116+ self assert: confidenceLevel - 79.8147614536 closeTo: 0
119117]
120118
121119{ #category : #statistics }
@@ -155,10 +153,8 @@ PMNumericalMethodsTestCase >> testIncompleteBetaFunction [
155153
156154{ #category : #' iterative algorithms' }
157155PMNumericalMethodsTestCase >> testIncompleteGammaFunction [
158- | function |
159- function := PMIncompleteGammaFunction shape: 2 .
160- self
161- assert: ((function value: 2 ) - 0.59399414981 ) abs < 0.00000000001
156+
157+ self assert: ((PMIncompleteGammaFunction shape: 2 ) value: 2 ) - 0.59399414981 closeTo: 0
162158]
163159
164160{ #category : #' iterative algorithms' }
@@ -819,7 +815,7 @@ PMNumericalMethodsTestCase >> testOptimizeOneDimension [
819815 finder := PMOneVariableFunctionOptimizer maximizingFunction: distr.
820816 finder desiredPrecision: 1.0e-6 .
821817 maximum := finder evaluate.
822- self assert: ( maximum - 5 ) abs < 1.0e-6 .
818+ self assert: maximum - 5 closeTo: 0 .
823819 self assert: finder precision < 1.0e-6
824820]
825821
@@ -950,20 +946,18 @@ PMNumericalMethodsTestCase >> testSymmetricMatrixAdd3 [
950946
951947{ #category : #estimation }
952948PMNumericalMethodsTestCase >> testTTest [
949+
953950 | accC accMM confidenceLevel |
954951 accC := PMStatisticalMoments new .
955- #(5.56 5.89 4.66 5.69 5.34 4.79 4.80 7.86 3.64 5.70)
956- do: [ :x | accC accumulate: x ].
952+ #( 5.56 5.89 4.66 5.69 5.34 4.79 4.80 7.86 3.64 5.70 ) do: [ :x | accC accumulate: x ].
957953 accMM := PMStatisticalMoments new .
958- #(7.48 6.75 3.77 5.71 7.25 4.73 6.23 5.60 5.94 4.58)
959- do: [ :x | accMM accumulate: x ].
954+ #( 7.48 6.75 3.77 5.71 7.25 4.73 6.23 5.60 5.94 4.58 ) do: [ :x | accMM accumulate: x ].
960955 confidenceLevel := accC tConfidenceLevel: accMM.
961- self assert: (accC average - 5.393 ) abs < 0.000000001 .
962- self
963- assert: (accC standardDeviation - 1.0990809292 ) abs < 0.000000001 .
964- self assert: (accMM average - 5.804 ) abs < 0.000000001 .
965- self assert: (accMM standardDeviation - 1.19415428 ) abs < 0.000000001 .
966- self assert: (confidenceLevel - 56.6320739989 ) abs < 0.000000001
956+ self assert: accC average - 5.393 closeTo: 0 .
957+ self assert: accC standardDeviation - 1.0990809292 closeTo: 0 .
958+ self assert: accMM average - 5.804 closeTo: 0 .
959+ self assert: accMM standardDeviation - 1.19415428 closeTo: 0 .
960+ self assert: confidenceLevel - 56.6320739989 closeTo: 0
967961]
968962
969963{ #category : #' linear algebra' }
0 commit comments