mitchelloharawild / distributional

Vectorised distributions for R
https://pkg.mitchelloharawild.com/distributional
GNU General Public License v3.0
97 stars 15 forks source link

Suggest change in argument names in `dist_student_t` and `dist_normal` #76

Closed emitanaka closed 2 years ago

emitanaka commented 2 years ago

I reckon you should have the argument names as mean and sd and deprecate mu and sigma for dist_normal and dist_student_t. This is consistent with how you do other distributions, e.g. "shape" and "rate" in gamma distribution + how the stats::dnorm works too.

emitanaka commented 2 years ago

I can update the arguments + deprecation notice in a pull request if you want

mitchelloharawild commented 2 years ago

What do you think about aliasing the arguments, so that either mu or mean and sigma or sd can be used?

mjskay commented 2 years ago

Possible nitpick: for student t, sigma is not the standard deviation unless df = Inf, no? Perhaps a more "semantic" alias for sigma in student t would be "scale"?

mitchelloharawild commented 2 years ago

I think that's reason enough to not have mean and sd for student t distributions. The motivation for 'how stats does it' doesn't apply for this distribution anyway. Thanks for nitpicking :+1: