# Making Turing Fast with large numbers of parameters?

**URL:** <https://discourse.julialang.org/t/making-turing-fast-with-large-numbers-of-parameters/69072>\
**Category:** General Usage\
**Tags:** turing\
**Created:** [October 1, 2021, 7:53pm UTC](https://discourse.julialang.org/t/making-turing-fast-with-large-numbers-of-parameters/69072 "2021-10-01T19:53:43Z")\
**Posts on this page:** 1\
**Showing post:** 76

<div class="post-metadata">

**Author:** ![Stephen\_Wild](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephen_wild/32/19061_2.png) [@Stephen\_Wild](https://discourse.julialang.org/u/Stephen_Wild)\
**Post date:** [October 27, 2021, 12:42am UTC](https://discourse.julialang.org/t/making-turing-fast-with-large-numbers-of-parameters/69072/76 "2021-10-27T00:42:43Z")

</div>

Gotchya. My understanding (which is probably wrong) is that `arraydist` and `filldist` sped things up when dealing with parameters, but not for the observations. Hopefully someone will correct me if I am wrong.

You could write it using standard broadcasting syntax. That worked fine for me when I rewrote your model 2.

```julia

    θ = staffweights[staffid] .+ patientweights[patientid] .+ usewch .* wcwt
    totweight .~ Gamma.(15, θ ./ 14) 

```

Another option might be a custom distribution. An example using MvBinomial is [here](https://discourse.julialang.org/t/numerical-errors-in-logit-normal-model-using-turing-jl/30602/12).

My only other (probably unhelpful) suggestions at this point to keep things positive are the obvious options (e.g., log(y) or using a something like a Gamma distribution, as in your example), which I assume you have tried or cannot use.

---

_[View the full topic](https://discourse.julialang.org/t/making-turing-fast-with-large-numbers-of-parameters/69072)._
