You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I fitted a GB2 distribution to my income data and then got puzzled when examining the parameter estimates. I observed that for parameters similar to c(809.6687, 116.4727, 0.0342, 0.0278), the quantile values returned by qGB2 are somewhat strange. For instance, the 10% Percentile is still 0 which does not make sense to me, in particular when having a look at the associated density function. Also, using the random number generator rGB2 many 0 values are drawn from the distribution.
I compared the results to the ones by the GB2 R package. Here, the quantile values look more reasonable to me for the very same set of GB2 parameters. For standard GB2 parameters, the two packages return identical results but not for some extreme parameter values. Why is that and might this be a potential bug in the gamlss.dist package?
Thanks, Stefan @stefan-1997, for raising this point, very useful.
The differences come from GB2 using the d/p/q/r functions for the beta distribution, i.e., qbeta() and friends, while gamlss.dist relies on the F distribution, i.e., qf() and friends. I simplified your quantile example to:
Similar problems seem to occur with the corresponding "p" and "d" function where "beta" works but "f" does not in certain cases.
Whether this advantage of beta over F only applies to this case or more generally, I cannot say. But it might be worth having a closer look. Mikis @mstasinopoulos and Bob @rigbyr did you consider this when implementing GB2 in gamlss.dist?
Finally, the random number generator gamlss.dist::rGB2() uses the inversion method which is problematic for many distributions. Here, it inherits the pathologies above from qGB2(). In contrast, GB2::rgb2() directly uses rbeta() which, again, seems to be numerically more stable.
I fitted a GB2 distribution to my income data and then got puzzled when examining the parameter estimates. I observed that for parameters similar to
c(809.6687, 116.4727, 0.0342, 0.0278)
, the quantile values returned by qGB2 are somewhat strange. For instance, the 10% Percentile is still 0 which does not make sense to me, in particular when having a look at the associated density function. Also, using the random number generator rGB2 many 0 values are drawn from the distribution.I compared the results to the ones by the
GB2
R package. Here, the quantile values look more reasonable to me for the very same set of GB2 parameters. For standard GB2 parameters, the two packages return identical results but not for some extreme parameter values. Why is that and might this be a potential bug in the gamlss.dist package?Here, my example code:
The text was updated successfully, but these errors were encountered: