# Evaluate Turing model posterior with many parameters

**URL:** https://discourse.julialang.org/t/evaluate-turing-model-posterior-with-many-parameters/68699
**Category:** General Usage
**Tags:** turing
**Created:** [September 24, 2021, 2:27pm UTC](https://discourse.julialang.org/t/evaluate-turing-model-posterior-with-many-parameters/68699 "2021-09-24T14:27:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [September 24, 2021, 2:27pm UTC](https://discourse.julialang.org/t/evaluate-turing-model-posterior-with-many-parameters/68699/1 "2021-09-24T14:27:39Z")

</div>

I want to evaluate the non-normalized posterior of a Turing model at some point in the parameter space.

The [guide](https://turing.ml/dev/docs/using-turing/guide#querying-probabilities-from-model-or-chain) suggests the `prob"..."` or `logprob"..."` string macros for this, but it seems inconvenient if there’s more than a handful of parameters.

I have 7 parameters so it looks like this (please ignore the silly distributions in this MWE):

```julia
@model function gdemo(x, y)
    s² ~ InverseGamma(2, 3)
    m ~ Normal(0, sqrt(s²))
    n ~ Normal(0, sqrt(s²))
    p ~ Normal(0, sqrt(s²))
    q ~ Normal(0, sqrt(s²))
    r ~ Normal(0, sqrt(s²))
    s ~ Normal(0, sqrt(s²))
    x ~ Normal(m+n+p+q, sqrt(s²))
    y ~ Normal(q+r+s, sqrt(s²))
end

x = 0.1
y = 0.2

m = gdemo()

params = (s²=0.01, m=0.0, n=0.0, p=0.0, q=0.0, r=0.0, s=0.0)

logprob"x=x, y=y, s²=params.s², m=params.m, n=params.n, p=params.p, q=params.q, r=params.r, s=params.s | model=m"

```

Is there a more convenient way to get this log-probability? Something like `joint_logprob(m; x, y, params...)` ?
