Closed m1hawkgsm closed 7 years ago
@m1hawkgsm Thanks for the bug report. This is an interesting bug -- honestly I never thought of it, neither tested for it. Actually it concerns with literally every function in this package. Hopefully it can be easily fixed and will be in the next CRAN release of the package. In the next few days I'll post a fix on github and it will be available in the github version.
Dear package maintainer,
Could you please send me an email when push the bug-fixed version of extraDistr on CRAN?
Despite this bug, your package is particularly good, that's why I put in the task view. Soon I will update what are the core packages of the view. You might be added to the list.
By the way, on http://www.rpackages.io/view/Distributions, you can see that your package is regularly downloaded.
Christophe one of fitdistrplus' authors
@dutangc Thanks for your message. I hope to find some time to post fixes and test them in the following week or two and then post in on CRAN. I'll remember to e-mail you then.
Found this through using the
fitdistrplus
package when estimating a generalized pareto distribution, but realized it does the same effect on a number ofp
distribution functions (testedpgpd
,pbbinom
,pgev
all fail, but seems okay with some likepnorm
andpdgamma
).Basically, if I run
pgpd(q = numeric(0), mu = 0, sigma= 1, xi = 0, lower.tail = TRUE, log.p = FALSE)
, R crashes. Similarly for other functions mentioned (not sure if more, didn't check all of yourp
functions).Reason why this matters: I'm estimating a distribution using censored data via MLE using
fitdistcens
from the packagefitidistrplus
and it builds the likelihood function as if we have left/right/interval censored data (meaning, if I actually don't have all three, part of the function ends up calling the distribution function fromextraDistr
with emptynumeric(0)
quantile argument. Normally that's fine as, for example,ppois
just returnsnumeric(0)
which is exactly what one would expect (and not a crash).Guessing the underlying C++ should have a length check or something? I already bothered the
fitdistrplus
authors to include checks if there's actually data for each type of censoring when building these function calls, but figured you'd like to know.