prob
prob copied to clipboard
Overflow/underflow
The chi square CDF does not account for underflow or overflow and therefore can emit (very) wrong answers.
package demo
import (
"math"
"testing"
"github.com/atgjack/prob"
)
func TestProb(t *testing.T) {
N := 200.0
v := prob.ChiSquared{1}
t.Log(1 - v.Cdf(N))
}
This will yield ~ 0.4933. The correct answer is approximately 0. Either extremes chi square values should be handled, or an error (or a panic, as is done by the probab/dst functions) should be returned. (I'm using github.com/tokenme/probab/dst instead so I don't plan on submitting a pull request -- my apologies -- but I do want to at least mention the issue.)