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
Is your feature request related to a problem? Please describe.
When the log-likelihood of a Tweedie distribution (compound Poisson-Gamma) is computed, one needs to evaluation np.log(wright_bessel(a, 0, x)) where 0<a<inf and x is potentially large. This can lead to inf or nan value, see statsmodels/statsmodels#9234.
Describe the solution you'd like.
Provide a new function log_wright_bessel that takes care for large x. Similar functions are
Is your feature request related to a problem? Please describe.
When the log-likelihood of a Tweedie distribution (compound Poisson-Gamma) is computed, one needs to evaluation
np.log(wright_bessel(a, 0, x))
where0<a<inf
andx
is potentially large. This can lead toinf
ornan
value, see statsmodels/statsmodels#9234.Describe the solution you'd like.
Provide a new function
log_wright_bessel
that takes care for largex
. Similar functions areDescribe alternatives you've considered.
No response
Additional context (e.g. screenshots, GIFs)
The implementation would be relatively straight forward:
wb_small_a
: Replace multiplicativeexp(x) * rgamma(b)
by+x-loggamma(b)
wb_large_a
: similarwb_asymptotic
: replace multiplicativestd::pow(Z, 0.5 - b) * std::exp(Ap1[1] / a * Z)
by+(0.5 - b) * log(Z) + Ap1[1] / a * Z
This would already work for most cases.
wright_bessel
was introduced in v1.7.0 with PR #11313.The text was updated successfully, but these errors were encountered: