commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <>
Subject [math] Re: Question about TestUtils.chiSquare
Date Fri, 18 Jul 2008 16:00:27 GMT
First of all, please prefix your message with the name of the commons
sub-project in brackets when using this list. It is shared by many
sub-projects and it helps people setting up filters for their topics of

Yannick a écrit :
> Hello,
> I'm wondering why the chi-square test has this API:
> chiSquareTest(double[] expected, long[] observed) 

As far as I understand, what is computed here is a Chi-square
goodness-of-fit test or Pearson's Chi-square test. The semantics of this
arguments were originally related to a number of real observation which
can only be integer values.

However, looking at the implementation, it appears that the long values
are converted to double almost everywhere, so it would at least from a
computational point of view to convert it. I am not sure about the
"meaning" of this as I am not a statistician.

If you would like to see this behaviour changed and new signatures added
to the existing ones, please open a feature enhancement ticket in our
JIRA issue tracking system at
You'll have to register to the system before being allowed to open a ticket.


> -
> I would think the type of expected and observed should be the same (for
> example, both double, like in the situation I have, where my series
> consists of purchase amounts on a website under two different
> conditions). 
> Am I missing something trivial? Why is there no chiSquareTest(double[] expected, double[]
observed) test?
> Thanks!
> Yannick
>       __________________________________________________________________
> Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the
All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail today or register for
free at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message