# Inferring Dirichlet concentration parameter

**URL:** https://discourse.pymc.io/t/inferring-dirichlet-concentration-parameter/5058
**Category:** Questions
**Created:** [May 10, 2020, 10:46am UTC](https://discourse.pymc.io/t/inferring-dirichlet-concentration-parameter/5058 "2020-05-10T10:46:36Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![fabianmoss](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/fabianmoss/32/1618_2.png) [@fabianmoss](https://discourse.pymc.io/u/fabianmoss)
#### Post date: [May 12, 2020, 10:09am UTC](https://discourse.pymc.io/t/inferring-dirichlet-concentration-parameter/5058/10 "2020-05-12T10:09:31Z")

</div>

**Update:** Looking at [this post](https://discourse.pymc.io/t/error-when-running-glm-logistic-ipynb-bad-initial-energy-inf/2415), I got it to run on Windows WSL (Ubuntu) with

```auto
with pm.Model() as model:
    gamma = pm.Gamma("gamma", alpha=1., beta=1., shape=K)
    theta = pm.Dirichlet("theta", a=gamma, shape=K, observed=x)

    trace = pm.sample(draws=1000, cores=2, init="adapt_diag", tune=1000)

```

Everything seems to work fine for the first 2000 iterations (first half), but for the second half I get only divergences and the output reads `The chain contains only diverging samples. The model is probably misspecified`.

---

_[View the full topic](https://discourse.pymc.io/t/inferring-dirichlet-concentration-parameter/5058)._
