1

I am using apache-commons-math for Inverse cumulative beta distribution function but it gives incorrect results for values smaller than 2E-15. Up to values 2E-15, results are correct and are also verified from R.

Value 2E-15
Result in R = -7.854929
Result in Java  = -7.8529

Value 2E-16
Result in R = -8.1385
Result in Java  = -35355339.059

Can anyone please suggest me any solution

K.Liaqat
  • 143
  • 1
  • 3
  • 14

1 Answers1

1

The inverse CDF for the Beta Distribution has a range of [0, 1]. Since both R and Apache Commons Math are returning negative values there are obviously some numerical errors in computing the inverse CDF for such small probabilities.

There likely is no numerical solution to your problem. Instead, it should be sufficient to treat all negative output from the inverse CDF as zero.

Brent Worden
  • 10,624
  • 7
  • 52
  • 57