# PyMC3 Half Cauchy Small Beta Values Lead to Errors

**URL:** <https://discourse.pymc.io/t/pymc3-half-cauchy-small-beta-values-lead-to-errors/8699>\
**Category:** Questions\
**Created:** [February 1, 2022, 2:15pm UTC](https://discourse.pymc.io/t/pymc3-half-cauchy-small-beta-values-lead-to-errors/8699 "2022-02-01T14:15:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michnag](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/michnag/32/3376_2.png) [@michnag](https://discourse.pymc.io/u/michnag)\
**Post date:** [February 1, 2022, 2:15pm UTC](https://discourse.pymc.io/t/pymc3-half-cauchy-small-beta-values-lead-to-errors/8699/1 "2022-02-01T14:15:40Z")

</div>

Whenever I choose values for beta in `pm.HalfCauchy` smaller than 0.1 (e.g. `tau = pm.HalfCauchy(name="tau", beta=0.01)`)  
I get the following error:

ValueError: Mass matrix contains zeros on the diagonal.  
The derivative of RV `C`.ravel()[0] is zero.

If I increase the value to \> 0.1 the same model works, however.  
How can I work around this issue?

---

<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:** [February 1, 2022, 2:47pm UTC](https://discourse.pymc.io/t/pymc3-half-cauchy-small-beta-values-lead-to-errors/8699/2 "2022-02-01T14:47:51Z")

</div>

See [this discussion](https://discourse.pymc.io/t/chain-1-failed-due-to-mass-matrix-contains-zeros-on-the-diagonal/8677/3) and see if that helps at all. When dealing with small parameter values I prefer the “adapt\_diag” initialization.
