# Avoiding loops in Turing

**URL:** <https://discourse.julialang.org/t/avoiding-loops-in-turing/59830>\
**Category:** Probabilistic Programming\
**Tags:** turing\
**Created:** [April 22, 2021, 9:36pm UTC](https://discourse.julialang.org/t/avoiding-loops-in-turing/59830 "2021-04-22T21:36:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [April 23, 2021, 9:10am UTC](https://discourse.julialang.org/t/avoiding-loops-in-turing/59830/2 "2021-04-23T09:10:52Z")

</div>

I’m not sure what might be wrong here. The speed up, which is even more dramatic on my machine, leads me to wonder if there is an error.

However, you might be able to marginalize out class and pos to obtain better performance. See this [example](https://discourse.julialang.org/t/strange-issues-fitting-gmms-in-turing-jl-by-extending-a-fairly-simple-example/55232/6).

---

_[View the full topic](https://discourse.julialang.org/t/avoiding-loops-in-turing/59830)._
