commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [Math] Error message from "RandomDataGeneratorTest"
Date Tue, 12 Jan 2016 19:55:50 GMT
On 1/12/16 12:16 PM, Phil Steitz wrote:
> On 1/12/16 11:44 AM, Gilles wrote:
>> Hi.
>>
>> This unit test class uses a method "checkNextLongUniform" which in
>> turn calls
>> "assertChiSquareAccept". When failure is detected, the latter
>> produces an output
>> like the following:
>>
>> [...]
>> checkNextLongUniform:228 Chisquare test failed p-value =
>> 0.003941271563188575 chisquare statistic = 27.439999999999998.
>> value   expected        observed
>> 1       0.08            91
>> 2       0.08            75
>> 3       0.08            106
>> 4       0.08            76
>> 5       0.08            71
>> 6       0.08            89
>> 7       0.08            87
>> 8       0.08            96
>> 9       0.08            61
>> 10      0.08            65
>> 11      0.08            80
>> 12      0.08            103
>>
>> For comparing, it is a bit awkward to have relative "expected"
>> counts vs
>> absolute "observed" counts...
> Good point.  It would be better to display the expected counts
> rather than proportions in that column.

Actually, what is going on here is the robustness of our
ChiSquareTest impl is compensating for what is arguably an error in
the checkNextLongUniform test implementation.  The ChiSquareTest
rescales the expected array, which is being provided as proportions
rather than counts by this test case.  It would be better to modify
the test to pass the expected (uniform) proportion times the sample
size as expected count.  So the right fix here is local to
checkNextLongUniform.

Phil
>
> Phil
>> I also think that the format of the "expected" frequencies should
>> display
>> more than 2 digits after the decimal point.
>>
>>
>> Regards,
>> Gilles
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message