pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

Guide for writing custom distributions

Open ally-lee opened this issue 3 years ago • 1 comments

I would like to contribute a guide for defining custom PyMC3 distributions. I was working with count data and realized that the Poisson distribution didn't offer the flexibility in dispersion I needed since the mean and variance are fixed to each other. I decided that the Generalized Poisson was a better likelihood for my model, so I wrote a custom distribution for it. I have put together a notebook outlining this, and I'll link my PR to this issue.

I posted about this on discourse a while back, so it would be great to post updates for the community in this thread: https://discourse.pymc.io/t/generalized-poisson-distribution/6535

Since I have now worked with the Generalized Poisson in PyMC3, I would also like to contribute this distribution to the main project: https://github.com/pymc-devs/pymc3/pull/4775

File: Reviewers:

The sections below may still be pending. If so, the issue is still available, it simply doesn't have specific guidance yet. Please refer to this overview of updates

Known changes needed

Changes listed in this section should all be done at some point in order to get this notebook to a "Best Practices" state. However, these are probably not enough! Make sure to thoroughly review the notebook and search for other updates.

General updates

ArviZ related

Changes for discussion

Changes listed in this section are up for discussion, these are ideas on how to improve the notebook but may not have a clear implementation, or fix some know issue only partially.

General updates

ArviZ related

Notes

Exotic dependencies

Computing requirements

ally-lee avatar Jun 20 '21 18:06 ally-lee

Just flagging up that this notebook is still needs to be updated from PyMC3

drbenvincent avatar Feb 21 '23 10:02 drbenvincent