rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

unexpected result of cdf_student_t / FIX #3091

Closed rtoy closed 1 week ago

rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:11 Created by *anonymous on 2008-08-12 20:00:23 Original: https://sourceforge.net/p/maxima/bugs/1476


commands: (%i1) load ( distrib ) $ (%i2) numer : true $ (%i3) cdf_student_t ( 1e-7, 1 );
(%o3) .5000000318182651 (%i4) cdf_student_t ( 1e-8, 1 ); (%o4) 1.0

comment: %o3 looks reasonable, %o4 does not.

build information: Maxima version: 5.15.0 Maxima build date: 10:21 6/17/2008 host type: i386-redhat-linux-gnu lisp-implementation-type: SBCL lisp-implementation-version: 1.0.17

rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:12 Created by robert_dodier on 2008-08-18 05:23:27 Original: https://sourceforge.net/p/maxima/bugs/1476/#35aa


rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:16 Created by robert_dodier on 2008-08-18 05:23:27 Original: https://sourceforge.net/p/maxima/bugs/1476/#6d01


Logged In: YES user_id=501686 Originator: NO

The function IBETA in share/contrib/distrib/numdistrib.lisp shows

(defun ibeta (x a b) (declare (type flonum x a b)) (cond ((or (= x 0) (= x 1)) 0.0)

etc, which is incorrect: when x = 1 the result is 1, not 0.

So that should be changed to (cond ((= x 0) 0.0) ((= x 1) 1.0) ...

A secondary consideration is that fn/(fx*fx+fn) can be rearranged to fx^2/(fx^2 + fn) which is preferable when fx < fn. (grind(cdf_student_t) shows the formula.)

rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:19 Created by riotorto on 2008-08-18 08:18:48 Original: https://sourceforge.net/p/maxima/bugs/1476/#1d93


Logged In: YES user_id=1270759 Originator: NO

The reported bug is not present in the current cvs version of Maxima.

Thank you for your report. If you see this bug in a later version of Maxima, please submit a new bug report.

rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:22 Created by robert_dodier on 2008-08-24 04:24:05 Original: https://sourceforge.net/p/maxima/bugs/1476/#d23c


Logged In: YES user_id=501686 Originator: NO

Fixed by recent commit for share/contrib/distrib/numdistrib.lisp. Fix is present in 5.16 branch. Closing this report as fixed.

rtoy commented 1 week ago

Imported from SourceForge on 2024-07-07 13:40:26 Created by robert_dodier on 2008-08-24 04:24:05 Original: https://sourceforge.net/p/maxima/bugs/1476/#fa31