You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gilles <gi...@harfang.homelinux.org> on 2016/01/12 19:44:46 UTC

[Math] Error message from "RandomDataGeneratorTest"

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...

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


Re: [Math] Error message from "RandomDataGeneratorTest"

Posted by Phil Steitz <ph...@gmail.com>.
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


Re: [Math] Error message from "RandomDataGeneratorTest"

Posted by Phil Steitz <ph...@gmail.com>.
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.

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