Skip to content

Conversation

twiecki
Copy link
Member

@twiecki twiecki commented Dec 18, 2018

A long time ago I made the terrible choice of naming the scale parameter of the Normal distribution sd instead of sigma. This is a terrible choice because all our other parameter names follow greek names, so it should either be mean and sd, or mu and sigma. Since we're using greek everywhere else it should be the same for sd, I mean sigma...

This was also rightfully criticized by @bob-carpenter in his blog post https://andrewgelman.com/2017/05/31/compare-stan-pymc3-edward-hello-world/
image

This so far replaces sd->sigma everywhere in the continuous.py but also allows passing sd to keep backwards compatibility. I don't think we should really deprecate this because everyone is using it but allow for a more consistent naming to emerge.

If we decide to go ahead we should probably also fix this in the docs, so I marked this as WIP.

_, sd = get_tau_sd(tau=kwargs.pop('tau', None),
sd=kwargs.pop('sd', None))
if 'sd' in kwargs.keys():
kwargs['sigma'] = kwargs.pop('sd')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it warn about deprecation?



def rho2sd(rho):
def rho2sigma(rho):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a backward compat function warning about deprecation is needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 We should have rho2d = rho2sigma

@ferrine
Copy link
Member

ferrine commented Dec 18, 2018

When should we drop support for old convention?

  • never? Just warn users to use proper convention
  • on next 3.7 release? 3.6 should warn I suppose

@twiecki
Copy link
Member Author

twiecki commented Dec 19, 2018

I'm not sure we should ever drop support, but high uncertainty on what the best course of action is. If we strongly feel that this renaming is the right way forward, we should raise a deprecation warning in the next release and drop it after.

@fonnesbeck
Copy link
Member

I agree that adopting Greek as a package-wide convention is a good idea. I don't think there's any harm in allowing sd to be specified in perpetuity for the sake of compatibility.

@twiecki twiecki removed the WIP label Dec 22, 2018
@twiecki
Copy link
Member Author

twiecki commented Dec 22, 2018

Docs are updated and made a comment in the release notes.

@twiecki twiecki force-pushed the rename_sd_to_sigma branch 2 times, most recently from 5f4aede to 53e1ce2 Compare December 22, 2018 11:57
@twiecki twiecki merged commit 37c0a92 into master Dec 23, 2018
@twiecki twiecki deleted the rename_sd_to_sigma branch December 23, 2018 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants