Re: Zero-inflated and/or upper-censored Poisson / negative binomial distributions

"Malte T" <[email protected]> Sat, 09 Sep 2023 19:05:01 -0000
Newsgroups gmane.comp.python.scientific.devel
Message-ID <[email protected]>
Hi Robert, 
thank you for your quick reply. Good point to think of how this could be applied to other distributions. In principle, one could imagine a distribution factory, along the lines of a 
get_zero_inflated_distribution(uninflated_distribution: rv_discrete, zero_inflation_rate: float) ->  rv_discrete
and
get_censored_distribution(uncensored_distribution: rv_discrete, upper_censoring_threshold: int) -> rv_discrete
that applies zero-inflation / censoring to any given distribution. For quite a few of the rv_discrete-methods, applying zero-inflation or censoring is easy/trivial (e.g. CDF(zero inflated distribution) = zero_inflation_rate + (1 - zero_inflation) * CDF(uninflated original distribution) ), but for the variance etc., it is quite involved (as far as I remember) - so I'm not sure that is feasible in general. 
I will look into it and open a PR, having in mind future extensions to other distributions.
Best regards,
Malte
_______________________________________________
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]