scalanlp / breeze

Breeze is a numerical processing library for Scala.
www.scalanlp.org
Apache License 2.0
3.44k stars 691 forks source link

Fix t-test p-value calculation (cdf instead of pdf) #847

Closed smoteval closed 6 months ago

smoteval commented 2 years ago

P value of test should use cumulative distribution function. The probability-density function of a distribution means the density function at a certain point!

For example, if we are testing mu1 < mu2 with t-score of t, we get p-value by cdf(t) = P(X < t) whereas pdf(t) = P(X=t)

Tested the result and now they agree with scipy function test_ind_from_stats