# Why GLM module doesn't have HalfStudentT distribution in Family?

**URL:** <https://discourse.pymc.io/t/why-glm-module-doesnt-have-halfstudentt-distribution-in-family/7991>\
**Category:** General\
**Created:** [September 7, 2021, 9:32pm UTC](https://discourse.pymc.io/t/why-glm-module-doesnt-have-halfstudentt-distribution-in-family/7991 "2021-09-07T21:32:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanko](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/vanko/32/4509_2.png) [@vanko](https://discourse.pymc.io/u/vanko)\
**Post date:** [September 7, 2021, 9:32pm UTC](https://discourse.pymc.io/t/why-glm-module-doesnt-have-halfstudentt-distribution-in-family/7991/1 "2021-09-07T21:32:35Z")

</div>

This is my priors:

d\_priors:

{‘Intercept’: \<pymc3.distributions.continuous.Normal at 0x2adb3679a90\>,  
‘TV\_ANE’: \<pymc3.distributions.continuous.HalfStudentT at 0x2adb3679da0\>,  
‘TV\_AMC’: \<pymc3.distributions.continuous.HalfStudentT at 0x2adb3679e10\>,  
‘TV\_ANIMALPLANET’: \<pymc3.distributions.continuous.HalfStudentT at 0x2adaea2e240\>,  
‘TV\_BBCAMERICA’: \<pymc3.distributions.continuous.HalfStudentT at 0x2adb31895c0\>,

My predictions from the model can be only positive numbers including ‘0’  
So I want to specify my Likelyhood as HalfStudentT but GLM doesn’t have it:

module ‘pymc3.glm.families’ has no attribute ‘HalfStudentT’

How can I do it ?

# Context for the model

with pm.Model() as model\_glm\_halfstud:

```
family = pm.glm.families.HalfStudentT()

pm.GLM.from_formula(formula,
                    data = data, 
                    priors = d_priors,
                    family = family)

```

If I can do it without GLM, please show me how. Thank you.

---

<div class="post-metadata">

**Author:** ![cluhmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cluhmann/32/3083_2.png) [@cluhmann](https://discourse.pymc.io/u/cluhmann)\
**Post date:** [September 7, 2021, 10:09pm UTC](https://discourse.pymc.io/t/why-glm-module-doesnt-have-halfstudentt-distribution-in-family/7991/2 "2021-09-07T22:09:07Z")

</div>

As [we discussed previously](https://discourse.pymc.io/t/halfstudentt-distribution-for-the-likelyhood-the-derivative-is-zero-problem/7975), it’s not at all clear why you want a half Student’s t as your (inverse) link function. If you are trying to predict (non-negative) counts, then the canonical way to go is with [Poisson](https://docs.pymc.io/api/distributions/discrete.html#pymc3.distributions.discrete.Poisson), [zero-inflated Poisson](https://docs.pymc.io/api/distributions/discrete.html#pymc3.distributions.discrete.ZeroInflatedPoisson), or [negative binomial](https://docs.pymc.io/api/distributions/discrete.html#pymc3.distributions.discrete.NegativeBinomial). All will ensure that negative outcomes are impossible, but will permit your model to predict something useful (e.g., the location/mean of the distribution).
