Hello,

I have the following simple Turing model:

```
@model function opt(y, λ, sa, sb)
α ~ Exponential(λ)
β ~ Exponential(λ)
end
```

I would like to sample from a posterior custom distribution similar to:

```
(beta(α, β) ^ - length(y)) * exp(- α * (λ - sa)) * exp(- β * (λ -sb))
```

(where beta is not the Beta distribution but the beta function in SpecialFunctions.jl)

I have tried to use the for loop on the posterior function:

```
for i in 1:length(y)
y[i] ~ (beta(α, β) ^ - length(y)) * exp(- α * (λ - sa)) * exp(- β * (λ -sb))
end
```

But doesn’t work because the function is not of type Distribution. I think I should define a custom posterior distribution.

I have alrady read the documentation at Advanced Usage . But the explained example of custom distribution is very different from the distribution I would like to obtain. Could you suggest me any {solution/something to read/rtfm} to define a custom distribution similar to that function? In general I would like to undestrand how define a custom distribution having a statistical model definition.

Thank you.