Skip to content

pchisq accuracy (PR#14216)

1 message · Jerry.Lewis at biogenidec.com

#
Full_Name: Jerry W. Lewis
Version: 2.10.1
OS: Windows XP Professional
Submission from: (NULL) (166.186.168.21)


Since
  pchisq(x,df,ncp,lower.tail,TRUE)
is calculated as
  log(pchisq(x,df,ncp,lower.tail))
it looses accuracy when pchisq(x,df,ncp,lower.tail) is near 1.  Accuracy can be
maintained in that case by replacing the existing calculation with
  log1p(-pchisq(x,df,ncp,!lower.tail))