Bug 13556 - besselI inaccurate for negative integer order
besselI inaccurate for negative integer order
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Analyses
old
ix86 (32-bit) Windows 32-bit
: P5 normal
Assigned To: Jitterbug compatibility account
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-26 21:11 UTC by Jitterbug compatibility account
Modified: 2009-03-05 14:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-02-26 21:11:30 UTC
From: Jerry.Lewis@biogenidec.com
Full_Name: Jerry W. Lewis
Version: 2.8.1
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)


It should be the case that
  besselI(x,-nu) == besselI(x,nu) == besselI(x,abs(nu))
for integer nu, yet R currently can return ridiculous values when nu is a
negative integer.

For instance, besselI(9.6,-44) returns -234626490 instead of the correct value
of 5.9041042646307223e-25, while besselI(9.6,44) gives essentially machine
accuracy.

This is more than an idle mathematical curiosity, since one consequence is that
dskellam in the VGAM package can return values <0 or >1.

Comment 1 Jitterbug compatibility account 2009-03-05 14:44:42 UTC
From: Martin Maechler <maechler@stat.math.ethz.ch>
>>>>> "JL" == Jerry Lewis <Jerry.Lewis@biogenidec.com>
>>>>>     on Thu, 26 Feb 2009 16:15:11 +0100 (CET) writes:

    JL> Full_Name: Jerry W. Lewis
    JL> Version: 2.8.1
    JL> OS: Windows XP Professional
    JL> Submission from: (NULL) (198.180.131.16)


    JL> It should be the case that
    JL> besselI(x,-nu) == besselI(x,nu) == besselI(x,abs(nu))
    JL> for integer nu, yet R currently can return ridiculous values when nu is a
    JL> negative integer.

    JL> For instance, besselI(9.6,-44) returns -234626490 instead of the correct value
    JL> of 5.9041042646307223e-25, while besselI(9.6,44) gives essentially machine
    JL> accuracy.

Yes.  I have committed a bug-fix to both R-patched and R-devel.

Thank you for the report!
Martin Maechler, ETH Zurich


    JL> This is more than an idle mathematical curiosity, since
    JL> one consequence is that dskellam in the VGAM package can
    JL> return values <0 or >1.

Comment 2 Jitterbug compatibility account 2009-03-06 02:57:00 UTC
NOTES:
 Fixed in 2.8.1 patched
Comment 3 Jitterbug compatibility account 2009-03-06 02:57:08 UTC
Audit (from Jitterbug):
Thu Mar  5 21:57:08 2009	ripley	changed notes
Thu Mar  5 20:57:08 2009	ripley	moved from incoming to Analyses-fixed