Re: Zero-inflated and/or upper-censored Poisson / negative binomial distributions
Robert Kern <[email protected]> Fri, 8 Sep 2023 17:43:02 -0400
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <CAF6FJivCLs6r7zHZ00_BgOeh=mUJV-DvYoK9XXv_TmH5dNycoA@mail.gmail.com> |
On Fri, Sep 8, 2023 at 3:48 PM <[email protected]> wrote: > Hi, > > I'm a newbie regarding scipy development; I've been using scipy for many > years, and I've implemented a zero-inflated and upper-censored variant of > the Poisson and negative-binomial distributions, which we are using quite > extensively. Those implementations inherit from rv_discrete. > > In words, that distribution describes a zero-inflated and censored > counting distribution of a random non-negative integer variable k, > characterized by (uncensored and non-inflated) mean rate mu, (in case of > negative binomial, by a dispersion parameter), an upper censoring threshold > and zero-inflation probability. Note that "truncated" (cut beyond threshold > & renormalized) is different from "censored" (map all values above > threshold to threshold). For censoring, all probability mass for events > with k > upper_censoring is concentrated at k=upper_censoring. We use this > quite a lot for modelling time series in retail in which finite stocks > (censoring) or occasional out-of-stock-situations (zero-inflation) occur. > > Since the detailed roadmap of scipy mentions "Implement additional widely > used continuous and discrete probability distributions, e.g. mixture > distributions.", I thought it might be interesting to add this to the > discrete distributions? > Yes, I would consider these worthwhile. I would suggest taking a look at all of the discrete distributions and evaluating whether and how this kind of modification might be worth applying to them too. Even if your only interest is in Poisson and negative-binomial now, we'd at least want to ensure that the parameters and their semantics can be applied the same way later to any applicable discrete distribution. -- Robert Kern _______________________________________________ SciPy-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: [email protected]