[SciPy-Dev] Tweedie distributions in scipy.stats
Christian Lorentzen
lorentzen.ch at gmail.com
Wed Mar 11 16:34:39 EDT 2020
Dear Scipy Developers and mailing list Readers
I'd like to address the issue [1] to implement Tweedie distributions [2]
in scipy.stats.
Purpose
The family of Tweedie distributions contains many known distributions
like the Poisson and the Gamma distribution, but also distributions
between them, aka compound poisson gamma distribution, see [3]. These
are often appropriate for insurance claims and other fields, where one
has a (Poisson) random count process of events and every event has a
(Gamma) random size/amount.
The distribution would enable simulations, maximum likelihood estimation
of all parameters, choice and visualization of distributions, etc.
Implementation
I started PR [4] for Wrights generalized Bessel functions as a private
function in scipy.special.
Once this is ready, the pdf follows immediately.
For the range of interest of Y ~ compound poisson gamma distribution,
the distribution of Y has a point mass at zero and is otherwise
continuous for Y>0.
As already discussed in the issue [1], Tweedie might best fit as
|rv_generic|.
As such, it would be the first one, all others are either |rv_discrete|
or |rv_continuous|.
Without a template, I would need guidance how to implement a new rv_generic.
References:
[1] https://github.com/scipy/scipy/issues/11291
[2] https://en.wikipedia.org/wiki/Tweedie_distribution
[3] https://en.wikipedia.org/wiki/Compound_Poisson_distribution
[4] https://github.com/scipy/scipy/pull/11313
I'm looking forward to your feeback, thoughts and insights.
Kind regards,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20200311/b980424f/attachment.html>
More information about the SciPy-Dev
mailing list