<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 9:22 AM Ali Cetin <<a href="mailto:ali.cetin@outlook.com">ali.cetin@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<blockquote style="border-color:rgb(200,200,200);color:rgb(102,102,102);padding-left:1ex;margin-left:0.8ex;border-left-width:3px;border-left-style:solid">
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<span><br>
</span></div>
</blockquote>
<div id="gmail-m_6303464976780940490appendonsend"></div>
<div style="color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_6303464976780940490divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b> SciPy-Dev <scipy-dev-bounces+ali.cetin=<a href="mailto:outlook.com@python.org" target="_blank">outlook.com@python.org</a>> on behalf of Robert Kern <<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>><br>
<b>Sent:</b> Wednesday, January 2, 2019 21:07<br>
<b>To:</b> SciPy Developers List<br>
<b>Subject:</b> Re: [SciPy-Dev] Deprecate planck distribution?</font>
<div> </div>
</div>
<div>
<div dir="ltr">On Wed, Jan 2, 2019 at 1:36 AM Christoph Baumgarten <<a href="mailto:christoph.baumgarten@gmail.com" target="_blank">christoph.baumgarten@gmail.com</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> happy new year! <br>
><br>
> I noted that the Planck distribution is a geometric distribution with a different parametrization, see Issue #9359:<br>
><br>
> import numpy as np<br>
> from scipy.stats import planck, geom<br>
><br>
> a = 0.5<br>
> k = np.arange(20)<br>
> sum(abs(geom.pmf(k, 1-np.exp(-a), loc=-1) - planck.pmf(k, a))) # 1.30e-18<br>
><br>
> I don't know if there is a specific reason to have the Planck distribution in addition to the geometric. If not, I would propose to deprecate it.<br>
><br>
> Any views? Thanks<br>
<br>
If we were to turn back time, and the question was whether to *add* the Planck distribution given that we had the geometric distribution, I would probably be convinced by this. However, given that the Planck distribution has already been added, I don't think
 that it's worth removing it. The marginal cost to having this alternate parameterization is likely less than the cost of anyone changing their code.
<div><br>
</div>
<div>
<blockquote style="border-color:rgb(200,200,200);color:rgb(102,102,102);padding-left:1ex;margin-left:0.8ex;border-left-width:3px;border-left-style:solid">
The collection of probability distributions are also a place where some nontrivial duplication actually has some positive value. People typically come to `scipy.stats` with a distribution (with a name and specific parameterization conventions) already in mind.
 Having more than one parameterization available helps people recognize the distribution that they want; having an alternate present doesn't impair the search task while not having one they are looking for (or burying it in the Notes of the docstring of the
 canonical version) can make the search task much harder. It's a common complaint that `scipy.stats` doesn't expose certain common parameterizations of distributions, so we should probably be working to expand the collection of parameterizations rather than
 collapsing them.<br>
<br>
<div><br>
</div>
</blockquote>
</div>
<blockquote style="border-color:rgb(200,200,200);color:rgb(102,102,102);padding-left:1ex;margin-left:0.8ex;border-left-width:3px;border-left-style:solid">
<div>Robert Kern</div>
</blockquote>
<div>I agree with Robert on this one. If you want to go down that rat hole, you will quickly find that most distribution functions are mere special cases and/or alternative parameterizations of a few general classes of distributions. If the concern is code
 management, then it could be argued that an effort should be made on abstracting distribution functions from these more general classes. However, personally, I prefer transparency and consistency with established literature when it comes to parametrization.</div></div></div></div></blockquote><div><br></div><div>I think there is a good reason for implementing special cases instead of only general cases because then computational simplifications can be used, e.g. using only general distribution with several extra parameters is cumbersome and requires a lot more work for the user, e.g. in setting all the extra parameters to their special case values.</div><div><br></div><div>This is not the case for pure reparameterization that still have the same number of parameters.</div><div><br></div><div>The main straight jacket in the scipy.stats distribution case in terms of parameterization is that all continuous distributions use the loc-scale (plus possibly shape) parameterization.</div><div>I think there are enough maintainers now (where I don't count myself), that it would be feasible to add other distribution classes that don't have to follow the loc-scale parameterization, or that could be intermediate classes for groups of similar distributions.</div><div><br></div><div>For example, I think something similar to the frozen distribution class could be added that is just a Reparameterization class, i.e. internally delegates to a standard scipy distribution, but uses a parameterization and parameter transformation that is more common and more familiar to users.</div><div>Another advantage of reparameterization classes would be that estimation is often easier or more interpretable in a different parameterization. E.g. statsmodels uses negativebinomial in the mean-dispersion parameterization instead of the common negbin parameterization.<br></div><div>Another advantage of that is that the hessian, covariance of the parameter estimates has often a nicer shape in different parameterization.</div><div><br></div><div>A example for a intermediate class would be common support for distribution that are created by a transformation of another, mainly normal distribution.</div><div>This includes the Johnson system of distribution in the other open thread on the list.</div><div><br></div><div>(Just some thoughts, I'm currently not in this neighborhood of stats.)</div><div><br></div><div>Josef</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div dir="ltr">
<div><br>
</div>
<div>That's my two cents on the issue.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Ali Cetin</div>
</div>
</div>
</div>

_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org" target="_blank">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scipy-dev</a><br>
</blockquote></div></div>