Half normal & half student-t?


Are there any plans for or interest in implementing half normal or half student-t distributions? They are pretty handy as priors for hierarchical variance parameters, and as components of shrinkage priors like the regularized horseshoe (e.g., https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations).

Seems like the half Cauchy distribution (https://github.com/uber/pyro/blob/dev/pyro/distributions/half_cauchy.py) points the way forward to implementing these. I’m happy to open issues and/or take a stab at it if that’s helpful.


as you noted, transformed distributions can be easily added by extending the pyro.distributions.torch.TransformedDistribution as in the HalfCauchy. distributions are added on a per need basis, so if you end up implementing one, we welcome you to contribute it upstream!


I am implementing HalfNormal and porting HalfCauchy to PyTorch. Using TransformedDistribution is not straightforward because a TransformedDistribution’s log_prob does not automatically work with AbsTransform. My implementation still needs to pass some statistical tests. Stay tune!