| qpoisR | R Documentation | 
A pure R implementation, including many tuning parameter arguments, of R's own Rmathlib C code algorithm, but with more flexibility.
It is using Vectorize(qpoisR1, *) where the hidden
qpoisR1 works for numbers (aka ‘scalar’, length one)
arguments only, the same as the C code.
qpoisR(p, lambda, lower.tail = TRUE, log.p = FALSE,
       yLarge = 4096, # was hard wired to 1e5
       incF = 1/64,   # was hard wired to .001
       iShrink = 8,   # was hard wired to 100
       relTol = 1e-15,# was hard wired to 1e-15
       pfEps.n = 8,   # was hard wired to 64: "fuzz to ensure left continuity"
       pfEps.L = 2,   # was hard wired to 64:   "   "   ..
       fpf = 4, # *MUST* be >= 1 (did not exist previously)
       trace = 0)
| p,lambda,lower.tail,log.p | 
 | 
| yLarge | a positive number; in R up to 2021, was internally
hardwired to  | 
| incF | a positive “increment factor” (originally hardwired to
0.001), used only when  | 
| iShrink | a positive increment shrinking factor, used only when
 | 
| relTol | originally hard wired to 1e-15, defines the convergence
tolerance for the search iterations when  | 
| pfEps.n,pfEps.L | positive factors defining “fuzz to ensure
left continuity”, both originally hardwired to  p <- p * (1 - 64 *.Machine$double.eps) Now,  | 
| fpf | a number larger than  | 
| trace | logical (or integer) specifying if (and how much) output should be produced from the algorithm. | 
The defaults and exact meaning of the algorithmic tuning arguments from
yLarge to fpf were experimentally determined are subject to change.
a numeric vector like p recycled to the common lengths of p
and lambda.
Martin Maechler
qpois.
x <- 10*(15:25)
Pp <- ppois(x, lambda = 100, lower.tail = FALSE)  # no cancellation
qPp <- qpois(Pp, lambda = 100, lower.tail=FALSE)
table(x == qPp) # all TRUE ?
## future: if(getRversion() >= "4.2") stopifnot(x == qPp) # R-devel
qpRp <- qpoisR(Pp, lambda = 100, lower.tail=FALSE)
all.equal(x, qpRp, tol = 0)
stopifnot(all.equal(x, qpRp, tol = 1e-15))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.