Add distributions to fix interface inconsistency in dirichlet, wishart, and invwishart?

Hi team, The `dirichlet` distribution interface is inconsistent with several other multivariate distributions and itself: the `pdf` method expects the transpose of what the `rvs` method produces (gh-6006). `wishart` and `invwishart` have a similar issue (gh-6474). Three possible solutions are below. 0. Close gh-6006 and gh-6474 without changes. 1. For each offending distribution, create a new distribution that is the same besides resolving the inconsistency, and deprecate the old distribution. At the end of the deprecation cycle, the old name becomes an alias for the new distribution. 2. Where appropriate, add a parameter (e.g. `transpose`) that selects which convention the input of `pdf` is supposed to follow. This presents an unfortunate choice regarding the default behavior: either we have an immediate backward incompatibility, we're stuck with the `transpose` parameter forever, or we would need multiple deprecation cycles to get rid of the `transpose` parameter. Please join the discussion in gh-16042: https://github.com/scipy/scipy/pull/16042 Without feedback, the plan would be to add new distributions `multivariate_beta`, `multivariate_gamma`, and `multivariate_invgamma` corresponding with `dirichlet`, `wishart`, and `invwishart`, respectively. Thanks for your thoughts! -- Matt Haberland Assistant Professor BioResource and Agricultural Engineering 08A-3K, Cal Poly

+1 for the option 1: provide replacement distributions, deprecate the inconsistent ones. Alternative 0 is IMO somewhat worse, 2 is definitely worse. My 2c, Evgeni пн, 16 мая 2022 г., 19:27 Matt Haberland <mhaberla@calpoly.edu>:
Hi team,
The `dirichlet` distribution interface is inconsistent with several other multivariate distributions and itself: the `pdf` method expects the transpose of what the `rvs` method produces (gh-6006). `wishart` and `invwishart` have a similar issue (gh-6474). Three possible solutions are below.
0. Close gh-6006 and gh-6474 without changes. 1. For each offending distribution, create a new distribution that is the same besides resolving the inconsistency, and deprecate the old distribution. At the end of the deprecation cycle, the old name becomes an alias for the new distribution. 2. Where appropriate, add a parameter (e.g. `transpose`) that selects which convention the input of `pdf` is supposed to follow. This presents an unfortunate choice regarding the default behavior: either we have an immediate backward incompatibility, we're stuck with the `transpose` parameter forever, or we would need multiple deprecation cycles to get rid of the `transpose` parameter.
Please join the discussion in gh-16042: https://github.com/scipy/scipy/pull/16042 Without feedback, the plan would be to add new distributions `multivariate_beta`, `multivariate_gamma`, and `multivariate_invgamma` corresponding with `dirichlet`, `wishart`, and `invwishart`, respectively.
Thanks for your thoughts! -- Matt Haberland Assistant Professor BioResource and Agricultural Engineering 08A-3K, Cal Poly
_______________________________________________ SciPy-Dev mailing list -- scipy-dev@python.org To unsubscribe send an email to scipy-dev-leave@python.org https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: evgeny.burovskiy@gmail.com
participants (2)
-
Evgeni Burovski
-
Matt Haberland