From mwelinder at gmail.com  Thu May 26 22:55:28 2005
From: mwelinder at gmail.com (mwelinder@gmail.com)
Date: Thu May 26 22:55:36 2005
Subject: [Rd] qpois accuracy, efficiency, termination (PR#7900)
Message-ID: <20050526205528.058BB85B0@slim.kubism.ku.dk>

Full_Name: Morten Welinder
Version: 2.1.0
OS: src only
Submission from: (NULL) (216.223.241.226)


The qpois code has several problems in 2.1.0:

1. The code essentially does...

      z = qnorm(R_DT_qIv(porig), 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE);

   ...when it could just as well do...

      z = qnorm(porig, 0., 1., lower_tail, log_p);

   That would eliminate a lot of underflows.

2. A third party tells me that you want "gamma = 1 / sigma", not "gamma =
sigma".
   That should speed things up a lot.

3. If y>1/DBL_EPSILON (or a bit larger if intermediate results have better
   accuracy than double) then the loops will not terminate.  And, yes, the
   "fixme" is right that stepping is a bit too primitive.


[Rd] qpois accuracy, efficiency, termination (PR#7900)
mwelinder@gmail.com