chjackson / flexsurv

The flexsurv R package for flexible parametric survival and multi-state modelling
http://chjackson.github.io/flexsurv/
53 stars 28 forks source link

Some distribution functions return `-Inf` for `q<0` and `lower.tail = FALSE` #135

Closed ndunnewind closed 2 years ago

ndunnewind commented 2 years ago

The pgengamma(), pgompertz() and pllogis() functions return -Inf for q<0 and lower.tail = FALSE. Shouldn't this always return 1, consistent with the other flexsurv distributions and e.g. stats::plnorm()?

chjackson commented 2 years ago

Thanks for spotting and reporting, this bug was also in pgenf(). Fixed in https://github.com/chjackson/flexsurv-dev/commit/9dbfef739e37b4b8a04ff36000843a727f173d2d .