# @pymc.deterministic

**URL:** <https://discourse.pymc.io/t/pymc-deterministic/9911>\
**Category:** v5\
**Tags:** modeling\
**Created:** [July 14, 2022, 7:48pm UTC](https://discourse.pymc.io/t/pymc-deterministic/9911 "2022-07-14T19:48:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![szy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/szy/32/5384_2.png) [@szy](https://discourse.pymc.io/u/szy)\
**Post date:** [July 14, 2022, 7:48pm UTC](https://discourse.pymc.io/t/pymc-deterministic/9911/1 "2022-07-14T19:48:55Z")

</div>

Is @pymc.deterministic function header deprecated under V4? If so, how can I create a user-defined-function that takes in variables drawn from a distribution?

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [July 18, 2022, 7:27pm UTC](https://discourse.pymc.io/t/pymc-deterministic/9911/2 "2022-07-18T19:27:51Z")

</div>

You can just pass them into functions like regular variables. Picking an [example notebook](https://www.pymc.io/projects/examples/en/latest/generalized_linear_models/GLM-binomial-regression.html) at random, you can take this model

```python
coords = {"observation": data.index.values}

with pm.Model(coords=coords) as binomial_regression_model:
    x = pm.ConstantData("x", data["x"], dims="observation")
    # priors
    beta0 = pm.Normal("beta0", mu=0, sigma=1)
    beta1 = pm.Normal("beta1", mu=0, sigma=1)
    # linear model
    mu = beta0 + beta1 * x
    p = pm.Deterministic("p", pm.math.invlogit(mu), dims="observation")
    # likelihood
    pm.Binomial("y", n=n, p=p, observed=data["y"], dims="observation")

```

and do this instead

```auto
def my_func(beta0, beta1, x):
    return beta0 + beta1 * x

with pm.Model(coords=coords) as binomial_regression_model:
    x = pm.ConstantData("x", data["x"], dims="observation")
    # priors
    beta0 = pm.Normal("beta0", mu=0, sigma=1)
    beta1 = pm.Normal("beta1", mu=0, sigma=1)
    # linear model
    mu = my_func(beta0, beta1, x)
    p = pm.Deterministic("p", pm.math.invlogit(mu), dims="observation")
    # likelihood
    pm.Binomial("y", n=n, p=p, observed=data["y"], dims="observation")

```
