Re: [Rd] Non central chi squared bug (PR#9406)

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sat 02 Dec 2006 - 20:14:53 GMT

On 12/1/2006 6:21 AM, Duncan Murdoch wrote:

> On 12/1/2006 5:44 AM, alan.bain@gmail.com wrote:

>> Full_Name: Alan Bain
>> Version: 2.4.0
>> OS: XP
>> Submission from: (NULL) (155.140.122.227)
>>
>>
>>
>> Code for pnchisq contains following
>>
>> if (tSml) {
>>
>> if (x> f+ theta+ 5*sqrt(2*(f+2*theta) ))){
>> return 1.; /* better than 0 --- but definately FIXME */
>> }
>>
>> }
>>
>> This needs to check which tail has been requested; it is only correct if the
>> default lower_tail=1 has been requested; for upper tail should return 0 if more
>> than 5 std devs away from mean under these circumstances.
> 
> Could you post a test case to demonstrate this?  I don't see it:
> 
>  > pchisq(1000, 2, 1, FALSE)
> [1] 1.720202e-205
>  > pchisq(10000, 2, 1, FALSE)
> [1] 0
>  > pchisq(100000, 2, 1, FALSE)
> [1] 0
>  > pchisq(1000000, 2, 1, FALSE)
> [1] 0

Offline Alan told me that this only affects ncp > 80; I've fixed it (and a couple of other extreme cases) and will commit once testing is done.

Duncan Murdoch



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun Dec 03 07:17:58 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 02 Dec 2006 - 20:30:58 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.