octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60528] betaincinv throws error for some valid


From: Rik
Subject: [Octave-bug-tracker] [bug #60528] betaincinv throws error for some valid inputs
Date: Sat, 21 Aug 2021 17:44:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36

Follow-up Comment #7, bug #60528 (project octave):

Ideally, betaincinv() should produce whatever the pure math answer is.  But,
since Octave has limited precision the actual goal is that betainc and
betaincinv are inverses of each other such that


x == betainc (becaincinv (x));


For the test case, this holds


octave:21> betainc (betaincinv (1-1e-6, 3, 1, "upper"), 3, 1, "upper")
ans = 0.999999000000000
octave:22> ans - (1-1e-6)
ans = 0


So the issue is that betainc() for both .01 and (.01 + 3.977e-14) both yield
1-1e-6 exactly.  The case of a 'b' input of 1 is a special case and the value
for 'upper' tail is


y(b_one) = 1 - x(b_one) .^ a(b_one)
which for this case reduces to
y = 1 - x .^ 3;


Indeed, calculating this result shows that the two values yield the same
result.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60528>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]