spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jieyuan Chen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-15656) ChiSqTest for goodness of fit doesn't test against a wrong uniform distribution by default
Date Tue, 31 May 2016 03:31:12 GMT

     [ https://issues.apache.org/jira/browse/SPARK-15656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jieyuan Chen updated SPARK-15656:
---------------------------------
    Description: 
I've been running a ChiSqTest to test whether my samples fit a uniform distribution.
The documentation says that If a second vector to test against is not supplied as a parameter,
the test runs against a uniform distribution. But when I pass samples drawn from a normal
distribution, the p-value calculated is 1.0, which is wrong.
The problem is that in ChiSqTest.scala, the `chiSquared` function will generate a wrong uniform
distribution if the expected vector is not supplied.
The default generated samples should be 
val expArr = if (expected.size == 0) Array.tabulate(size)(i => i.toDouble / size) else
expected.toArray

  was:
I've been running a ChiSqTest to test whether my samples fit a uniform distribution.
The documentation says that If a second vector to test against is not supplied as a parameter,
the test runs against a uniform distribution. But when I pass samples drawn from a normal
distribution, the p-value calculated is 1.0, which is wrong.
The problem is that in ChiSqTest.scala, the `chiSquared` function will generate a wrong uniform
distribution if the expected vector is not supplied.


> ChiSqTest for goodness of fit doesn't test against a wrong uniform distribution by default
> ------------------------------------------------------------------------------------------
>
>                 Key: SPARK-15656
>                 URL: https://issues.apache.org/jira/browse/SPARK-15656
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 1.5.1, 1.6.1
>            Reporter: Jieyuan Chen
>              Labels: easyfix, mllib, stats
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> I've been running a ChiSqTest to test whether my samples fit a uniform distribution.
> The documentation says that If a second vector to test against is not supplied as a parameter,
the test runs against a uniform distribution. But when I pass samples drawn from a normal
distribution, the p-value calculated is 1.0, which is wrong.
> The problem is that in ChiSqTest.scala, the `chiSquared` function will generate a wrong
uniform distribution if the expected vector is not supplied.
> The default generated samples should be 
> val expArr = if (expected.size == 0) Array.tabulate(size)(i => i.toDouble / size)
else expected.toArray



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message