glum icon indicating copy to clipboard operation
glum copied to clipboard

Restructure distributions

Open lbittarello opened this issue 1 year ago • 0 comments

This PR restructures the distributions to avoid diamond inheritance -- i.e. the gamma, inverse Gaussian, normal and Poisson distributions no longer inherit from the Tweedie distribution. Because it is often convenient to test whether a distribution belongs to the Tweedie family, I added a to_tweedie method to the base class, which allows users to recover the Tweedie representation of a family if it exists. (I added an equivalent method to Link.)

Because it is a breaking change, the base branch is glum_v3.

Some free riders:

  • ExponentialDispersionModel.in_y_range has been cleaned up.
  • The documentation of the different distributions has been cleaned up and simplified.
  • Excessively restrictive type hints have been removed. A few new hints have been added.
  • Cython functions for the inverse Gaussian distribution have been added.
  • The parsing of Tweedie links in get_family has been aligned on get_family.

lbittarello avatar Feb 21 '24 15:02 lbittarello