# Confusing example in docs for Custom Distributions

**URL:** <https://discourse.pymc.io/t/confusing-example-in-docs-for-custom-distributions/4200>\
**Category:** Questions\
**Created:** [December 10, 2019, 11:40am UTC](https://discourse.pymc.io/t/confusing-example-in-docs-for-custom-distributions/4200 "2019-12-10T11:40:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [December 10, 2019, 11:40am UTC](https://discourse.pymc.io/t/confusing-example-in-docs-for-custom-distributions/4200/1 "2019-12-10T11:40:58Z")

</div>

I am trying to understand how custom distributions work in PyMC and I find the minimalistic example in the docs to be confusing. Namely, where does the lambda variable in the logp function come from? Is this supposed to be another variable in the model that is just being omitted here? Why doesn’t it have to be passed in the observed dict?

```
def logp(failure, value):
    return (failure * log(λ) - λ * value).sum()

exp_surv = pm.DensityDist('exp_surv', logp, observed={'failure':failure, 'value':t})
```

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [December 10, 2019, 2:09pm UTC](https://discourse.pymc.io/t/confusing-example-in-docs-for-custom-distributions/4200/2 "2019-12-10T14:09:53Z")

</div>

There are a bit more information from this FAQ maybe answers your question: [Frequently Asked Questions](https://discourse.pymc.io/t/frequently-asked-questions/74/10)
