Bugzilla – Full Text Bug Listing

Summary: | qpois still an error for degenerate distribution | ||
---|---|---|---|

Product: | R | Reporter: | t.yee <t.yee> |

Component: | Accuracy | Assignee: | R-core <R-core> |

Status: | CLOSED FIXED | ||

Severity: | minor | CC: | maechler, robbyjo |

Priority: | P5 | ||

Version: | R 3.3.* | ||

Hardware: | Other | ||

OS: | Linux |

Description
t.yee@auckland.ac.nz
2016-06-28 11:55:14 UTC
This would seem to be fixable by moving the line: if(lambda == 0) return 0; to just above mu = lambda; line. Thank you both. There is one problem with the proposed resolution: What should qpois(p = 1, lambda = 0) give? It currently gives '0' {and that is even tested for in the regression tests}, but would give 'Inf' with the proposed change.. Of course this case, is really a border case. Our usual reasoning is that limits should always work, but in this case, qpois(1, 0) may look "ill defined", as lim{p -> 1} qpois(p, 0) = 0 lim{lambda -> 0} qpois(p=1, lambda) = Inf but I think back compatibility should count more here, and more importantly, for dpois() and ppois() the limit behavior for lambda --> 0 is pretty well defined (also mentioned on the French version of the Wikipedia page), and then, as ppois(0, 0) = 1, for the inverse function qpois(), we really want qpois(p = 1, lambda = 0) |--> 0 Similar reasoning applies to other distributions with a limiting case of a point mass. I think their q<dist>() functions do not deal with this issue consistently... but don't have time now to check [[don't find it too important, too]]. I am dealing with qgeom(*, prob=1) now, and leave other cases (if they exist) for future reports / or (better) comments to this report. |