# Manually defined partially conjugate update step

**URL:** <https://discourse.julialang.org/t/manually-defined-partially-conjugate-update-step/51299>\
**Category:** Probabilistic Programming\
**Created:** [December 5, 2020, 1:41pm UTC](https://discourse.julialang.org/t/manually-defined-partially-conjugate-update-step/51299 "2020-12-05T13:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmeulen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fmeulen/32/19987_2.png) [@fmeulen](https://discourse.julialang.org/u/fmeulen)\
**Post date:** [December 5, 2020, 1:41pm UTC](https://discourse.julialang.org/t/manually-defined-partially-conjugate-update-step/51299/1 "2020-12-05T13:41:38Z")

</div>

I have a model where I can apply Turing to the full parameter vector, that seems to work. However, I can partition the parameter such that a Gibbs sampler can be devised where one parameter is updated in a partially conjugate step (the remainder of the parameters can be dealt with for example with HMC). Is there a way to pass the partially conjugate step to the model?

I know about syntax like

```julia
Gibbs(HMC(0.2, 3, :p), PG(20, :z))

```

So rather than `PG` I would like to to specify this step manually.

---

<div class="post-metadata">

**Author:** ![Jakob](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Post date:** [December 9, 2020, 7:14pm UTC](https://discourse.julialang.org/t/manually-defined-partially-conjugate-update-step/51299/2 "2020-12-09T19:14:36Z")

</div>

There is a [PR](https://github.com/TuringLang/Turing.jl/pull/1275) for this but I’m not sure if it is released or fully documented yet but there’s an [example](https://gist.github.com/phipsgabler/dfac25deceedd30c6642b8b6333797a0).

---

<div class="post-metadata">

**Author:** ![fmeulen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fmeulen/32/19987_2.png) [@fmeulen](https://discourse.julialang.org/u/fmeulen)\
**Post date:** [December 9, 2020, 8:05pm UTC](https://discourse.julialang.org/t/manually-defined-partially-conjugate-update-step/51299/3 "2020-12-09T20:05:05Z")

</div>

Thanks, the example is very helpful.
