# How to use a Deterministic in a mixture?

**URL:** <https://discourse.pymc.io/t/how-to-use-a-deterministic-in-a-mixture/1350>\
**Category:** Questions\
**Created:** [June 8, 2018, 3:26pm UTC](https://discourse.pymc.io/t/how-to-use-a-deterministic-in-a-mixture/1350 "2018-06-08T15:26:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![narendramukherjee](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/narendramukherjee/32/753_2.png) [@narendramukherjee](https://discourse.pymc.io/u/narendramukherjee)\
**Post date:** [June 11, 2018, 3:09am UTC](https://discourse.pymc.io/t/how-to-use-a-deterministic-in-a-mixture/1350/4 "2018-06-11T03:09:20Z")

</div>

I think the issue is that pm.DensityDist needs an observed value. Look at this discussion:

> [@How to set up a custom likelihood function for two variables](https://discourse.pymc.io/t/how-to-set-up-a-custom-likelihood-function-for-two-variables/906):
>
> In my case, likelihood function was defined as f(theta\_1, theta\_2), the expression is already known not a standard distribution. Prior of theta\_1 and theta\_2 are following lognormal distribution. How can I get the posterior distribution with certain sampling method? My code with pm.Model() as model: theta\_1 = pm.Lognormal('theta\_1', mu=mu\_1, sd=sigma\_1) theta\_2 = pm.Lognormal('theta\_2', mu=mu\_2, sd=sigma\_2) like = pm.DensityDist('like', likelihood(theta\_1,theta\_2),shape=(…

---

_[View the full topic](https://discourse.pymc.io/t/how-to-use-a-deterministic-in-a-mixture/1350)._
