# Include deterministic variables in the chain

**URL:** <https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047>\
**Category:** Probabilistic Programming\
**Tags:** turing\
**Created:** [December 26, 2023, 3:15am UTC](https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047 "2023-12-26T03:15:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markmbaum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/markmbaum/32/32745_2.png) [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Post date:** [December 26, 2023, 3:15am UTC](https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047/1 "2023-12-26T03:15:52Z")

</div>

This is a very basic question, but how can I include deterministic variables in the chain when sampling from a `Turing.jl` model?

---

<div class="post-metadata">

**Author:** ![torfjelde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torfjelde/32/206542_2.png) [@torfjelde](https://discourse.julialang.org/u/torfjelde)\
**Post date:** [January 25, 2024, 11:35pm UTC](https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047/2 "2024-01-25T23:35:23Z")

</div>

The closest thing you get is `Turing.generated_quantities` which allows you to do a post processing step and capture the return-values _conditioned_ on the values in a `chain`. This has greater flexibility at the cost of some runtime (though you’re _inference_ is still as fast).
