# \#turing

**URL:** https://discourse.julialang.org/tag/turing/236.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [NUTS algorithm in Turing.jl](https://discourse.julialang.org/t/nuts-algorithm-in-turing-jl/135592)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 7\
**Last updated:** [September 2, 2026, 3:52am UTC](https://discourse.julialang.org/t/nuts-algorithm-in-turing-jl/135592 "2026-09-02T03:52:43Z")

</div>

Dear all, Can someone explain to me that the n\_adapts in case NUTS algorithm NUTS(n\_adapts, δ) used in Turing sample function is number of iteration or number of accepted samples before main sampling? Because when I giv…

---

## [Proposal for TuringRegressions.jl - Bayesian regression model alternative to TuringGLM.jl](https://discourse.julialang.org/t/proposal-for-turingregressions-jl-bayesian-regression-model-alternative-to-turingglm-jl/138815)

<div class="topic-metadata">

**Author:** [@jalster](https://discourse.julialang.org/u/jalster)\
**Replies:** 7\
**Last updated:** [August 22, 2026, 12:10pm UTC](https://discourse.julialang.org/t/proposal-for-turingregressions-jl-bayesian-regression-model-alternative-to-turingglm-jl/138815 "2026-08-22T12:10:35Z")

</div>

Hi everyone, I would like to propose TuringRegressions.jl - a more fully featured alternative to TuringGLM.jl offering much more of what brms does in R, most notably: correlated random effect slopes, i.e. full support…

---

## [Exporting TuringGLM code](https://discourse.julialang.org/t/exporting-turingglm-code/110738)

<div class="topic-metadata">

**Author:** [@Sam\_P](https://discourse.julialang.org/u/Sam_P)\
**Replies:** 2\
**Last updated:** [August 15, 2026, 7:43am UTC](https://discourse.julialang.org/t/exporting-turingglm-code/110738 "2026-08-15T07:43:48Z")

</div>

Hi all - R and cmdstan user here trying his hands on Julia and Turing. Came across TuringGLM and I like its smooth interface akin to what brms is to RStan. I do want to learn the raw Turing code though, and was wonderi…

---

## [Customising Turing.jl sample progress bar](https://discourse.julialang.org/t/customising-turing-jl-sample-progress-bar/125110)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 3\
**Last updated:** [July 25, 2026, 5:51pm UTC](https://discourse.julialang.org/t/customising-turing-jl-sample-progress-bar/125110 "2026-07-25T17:51:36Z")

</div>

Hello, I was wondering that can we customise sampling progressbar during inference by Turing.jl? sample(model, NUTS(1000, 0.65), MCMCThreads(), 10000, 3, progress = true) At the moment it shows progress after 1/3 sam…

---

## [Maximum\_a\_posteriori not honoring abstol and reltol? Turing.jl](https://discourse.julialang.org/t/maximum-a-posteriori-not-honoring-abstol-and-reltol-turing-jl/133402)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 7\
**Last updated:** [June 26, 2026, 6:45am UTC](https://discourse.julialang.org/t/maximum-a-posteriori-not-honoring-abstol-and-reltol-turing-jl/133402 "2026-06-26T06:45:38Z")

</div>

So, my student has a problem where he’s just been letting maximum\_a\_priori run for as long as it needs… which is taking like 2000+ seconds… I suggested to try abstol or reltol to make sure it wasn’t spending all its time…

---

## [Nested submodels slow down Turing ~7x (Mooncake AD)](https://discourse.julialang.org/t/nested-submodels-slow-down-turing-7x-mooncake-ad/137679)

<div class="topic-metadata">

**Author:** [@simonsteiger](https://discourse.julialang.org/u/simonsteiger)\
**Replies:** 5\
**Last updated:** [June 20, 2026, 2:30pm UTC](https://discourse.julialang.org/t/nested-submodels-slow-down-turing-7x-mooncake-ad/137679 "2026-06-20T14:30:36Z")

</div>

I just discovered that nesting several submodels in Turing.jl seems to considerably slow down sampling (I only tried Mooncake.jl so far). The code below shows this with the eight schools dataset. I’ve deliberately made …

---

## [Spike-and-Slab Implementation using Turing.jl?](https://discourse.julialang.org/t/spike-and-slab-implementation-using-turing-jl/132816)

<div class="topic-metadata">

**Author:** [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Replies:** 3\
**Last updated:** [May 29, 2026, 9:47am UTC](https://discourse.julialang.org/t/spike-and-slab-implementation-using-turing-jl/132816 "2026-05-29T09:47:17Z")

</div>

So I was looking for an implementation of spike-and-slab prior using the Turing.jl package. Say I have a model as follows: y\_{ig} \\sim N(\\theta\_g, \\sigma^2) where g = 1, \\cdots, G and i = 1, \\cdots, n\_g independently A…

---

## [Compare two Turing models with LOO: SE is NaN](https://discourse.julialang.org/t/compare-two-turing-models-with-loo-se-is-nan/102269)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 7\
**Last updated:** [April 19, 2026, 1:17am UTC](https://discourse.julialang.org/t/compare-two-turing-models-with-loo-se-is-nan/102269 "2026-04-19T01:17:20Z")

</div>

I am trying to compare two SequentialSamplingModels with loo using ParetoSmooth.jl, but I think I am doing something wrong: using Turing using SequentialSamplingModels using Random using Distributions using DataFrames u…

---

## [Hidden Markov Model with fixed parameters](https://discourse.julialang.org/t/hidden-markov-model-with-fixed-parameters/126710)

<div class="topic-metadata">

**Author:** [@simonsteiger](https://discourse.julialang.org/u/simonsteiger)\
**Replies:** 13\
**Last updated:** [March 7, 2026, 6:58am UTC](https://discourse.julialang.org/t/hidden-markov-model-with-fixed-parameters/126710 "2026-03-07T06:58:40Z")

</div>

I am trying to model a sequence of behaviours with two end points as a hidden markov model. To do this, I tried fixing some parameters in the transition and emission matrices, but I ran into the following error: MethodE…

---

## [What is the canon way to randomly draw one (or more) parameter sets from a sampled distribution?](https://discourse.julialang.org/t/what-is-the-canon-way-to-randomly-draw-one-or-more-parameter-sets-from-a-sampled-distribution/135935)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 11\
**Last updated:** [March 2, 2026, 5:48pm UTC](https://discourse.julialang.org/t/what-is-the-canon-way-to-randomly-draw-one-or-more-parameter-sets-from-a-sampled-distribution/135935 "2026-03-02T17:48:15Z")

</div>

Using turing I have done n\_steps = 1000 n\_chains = 4 chain = sample(model, NUTS(), MCMCThreads(), n\_steps, n\_chains) I can plot the output using plot(chain) However, if I want to draw a random parameter set to do …

---

## [GSoC 2026 Interest - Turing.jl Gibbs Sampler Project](https://discourse.julialang.org/t/gsoc-2026-interest-turing-jl-gibbs-sampler-project/135888)

<div class="topic-metadata">

**Author:** [@Anurag\_Gupta](https://discourse.julialang.org/u/Anurag_Gupta)\
**Replies:** 0\
**Last updated:** [February 27, 2026, 6:11pm UTC](https://discourse.julialang.org/t/gsoc-2026-interest-turing-jl-gibbs-sampler-project/135888 "2026-02-27T18:11:19Z")

</div>

Title: GSoC 2025 Interest - Turing Gibbs Sampler Project Hi Julia community! I’m Anurag, a CS undergrad interested in applying for GSoC 2025 with Turing, specifically the “AbstractMCMC-based Gibbs Sampler” project. M…

---

## [Help with IR Manipulation](https://discourse.julialang.org/t/help-with-ir-manipulation/135724)

<div class="topic-metadata">

**Author:** [@charlesknipp](https://discourse.julialang.org/u/charlesknipp)\
**Replies:** 0\
**Last updated:** [February 18, 2026, 4:31pm UTC](https://discourse.julialang.org/t/help-with-ir-manipulation/135724 "2026-02-18T16:31:55Z")

</div>

Since this is a relatively complex stack, I will begin with an overarching explanation of my problem, then contextualize it further. Keeping it Vague Suppose I have a misty closure (MistyClosures.jl), where I want to sp…

---

## [Issue with Binomial distribution and recent ForwardDiff versions](https://discourse.julialang.org/t/issue-with-binomial-distribution-and-recent-forwarddiff-versions/134347)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 2\
**Last updated:** [December 12, 2025, 3:57pm UTC](https://discourse.julialang.org/t/issue-with-binomial-distribution-and-recent-forwarddiff-versions/134347 "2025-12-12T15:57:48Z")

</div>

Hi, recently I noticed some code I’ve been using broke after updating Forward Diff. The issue came from sampling with Turing using a binomial likelihood. Digging into it it boiled down to this: using ForwardDiff using …

---

## [Online talk – Survival Modeling with Turing.jl: A Case Study](https://discourse.julialang.org/t/online-talk-survival-modeling-with-turing-jl-a-case-study/128876)

<div class="topic-metadata">

**Author:** [@simonsteiger](https://discourse.julialang.org/u/simonsteiger)\
**Replies:** 20\
**Last updated:** [December 4, 2025, 1:08pm UTC](https://discourse.julialang.org/t/online-talk-survival-modeling-with-turing-jl-a-case-study/128876 "2025-12-04T13:08:41Z")

</div>

Hi everyone, A friend and I have been organising a seminar series on Bayesian statistics at Karolinska Institutet over the past few months. Next week, there’ll be a talk by @sunxd3 titled Survival Modeling with Turing.j…

---

## [Parallelism within Turing.jl model](https://discourse.julialang.org/t/parallelism-within-turing-jl-model/54064)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 10\
**Last updated:** [November 25, 2025, 2:08pm UTC](https://discourse.julialang.org/t/parallelism-within-turing-jl-model/54064 "2025-11-25T14:08:40Z")

</div>

Hi there, just wondering how safe it is to use Threads.@threads for loops within turing models e.g. @model function my\_func(Y) alpha ~ Normal(0,1) sigma ~ Normal(0,1) Threads.@threads for i in 1:size(Y)\[2…

---

## [NUTS mass matrix estimation and num\_warmup](https://discourse.julialang.org/t/nuts-mass-matrix-estimation-and-num-warmup/134046)

<div class="topic-metadata">

**Author:** [@contejuz](https://discourse.julialang.org/u/contejuz)\
**Replies:** 7\
**Last updated:** [November 24, 2025, 8:12pm UTC](https://discourse.julialang.org/t/nuts-mass-matrix-estimation-and-num-warmup/134046 "2025-11-24T20:12:47Z")

</div>

I have a distribution with a somewhat wide range of parameters in a hierarchical model. Some range are in \[0,1\], while another is in \[0,60\] roughly, with most mass around 20-30. a\_0 ~ Beta(8,2) b\_0 ~ truncated(Normal…

---

## [Mooncake, Turing, and CI](https://discourse.julialang.org/t/mooncake-turing-and-ci/134067)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 3\
**Last updated:** [November 24, 2025, 11:20am UTC](https://discourse.julialang.org/t/mooncake-turing-and-ci/134067 "2025-11-24T11:20:45Z")

</div>

Hello, I finally am switching to DifferentiationInterface for the tests of a package of mine and I don’t think I could be happier! It lets me quickly write tests in a coherent manner, to try different backends. Amazing…

---

## [Any solution for float 32 required by lux models embeded in Turing.jl](https://discourse.julialang.org/t/any-solution-for-float-32-required-by-lux-models-embeded-in-turing-jl/133202)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 3\
**Last updated:** [October 17, 2025, 11:25am UTC](https://discourse.julialang.org/t/any-solution-for-float-32-required-by-lux-models-embeded-in-turing-jl/133202 "2025-10-17T11:25:44Z")

</div>

Hi I have trained Variational Autoencoder from Lux.jl embeded inside a Turing.jl model. But I am unable to convert a latent variable to float32 to pass it through Lux.jl model to get its ouput. I saw a post here (Issue w…

---

## [Fitting multiple datasets simultaneously](https://discourse.julialang.org/t/fitting-multiple-datasets-simultaneously/132176)

<div class="topic-metadata">

**Author:** [@soniamitchell](https://discourse.julialang.org/u/soniamitchell)\
**Replies:** 9\
**Last updated:** [September 25, 2025, 1:10pm UTC](https://discourse.julialang.org/t/fitting-multiple-datasets-simultaneously/132176 "2025-09-25T13:10:28Z")

</div>

I want to fit a model to multiple datasets simultaneously, with some fitted parameters being shared across datasets. Is it possible to do this using Turing.jl?

---

## [How to mimick a Discrete Bayes Net in Turing.jl?](https://discourse.julialang.org/t/how-to-mimick-a-discrete-bayes-net-in-turing-jl/130319)

<div class="topic-metadata">

**Author:** [@nicolasg](https://discourse.julialang.org/u/nicolasg)\
**Replies:** 5\
**Last updated:** [September 23, 2025, 1:16pm UTC](https://discourse.julialang.org/t/how-to-mimick-a-discrete-bayes-net-in-turing-jl/130319 "2025-09-23T13:16:40Z")

</div>

Hi, I’ve been using Turing.jl for various purposes, and recently I thought it might be easy to mimick inference from a basic discrete bayesian network like I could do with BayesNets.jl like this for example: bn = Discr…

---

## [Hybrid MCMC Algorithm](https://discourse.julialang.org/t/hybrid-mcmc-algorithm/132400)

<div class="topic-metadata">

**Author:** [@jackmarry](https://discourse.julialang.org/u/jackmarry)\
**Replies:** 2\
**Last updated:** [September 21, 2025, 5:04pm UTC](https://discourse.julialang.org/t/hybrid-mcmc-algorithm/132400 "2025-09-21T17:04:25Z")

</div>

I saw the steps for a Bayesian estimation algorithm in a paper, and I was wondering if there’s a way to implement this kind of hybrid MCMC algorithm using the Turing.jl library.

---

## [Eval in Turing model](https://discourse.julialang.org/t/eval-in-turing-model/132397)

<div class="topic-metadata">

**Author:** [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Replies:** 4\
**Last updated:** [September 16, 2025, 11:08pm UTC](https://discourse.julialang.org/t/eval-in-turing-model/132397 "2025-09-16T23:08:52Z")

</div>

Hi, all. I am confusing if I use eval function like eval(Meta.parse("sigma ~ Normal(0,1)")) does it will affect the speed of model?

---

## [Compute Deviance Information Criterion for a Bayesian Model](https://discourse.julialang.org/t/compute-deviance-information-criterion-for-a-bayesian-model/132195)

<div class="topic-metadata">

**Author:** [@dhruva-ahuja](https://discourse.julialang.org/u/dhruva-ahuja)\
**Replies:** 1\
**Last updated:** [September 9, 2025, 9:05am UTC](https://discourse.julialang.org/t/compute-deviance-information-criterion-for-a-bayesian-model/132195 "2025-09-09T09:05:46Z")

</div>

Hello, I am struggling to compute Deviance Information Criterion (DIC) in Julia as Turing/MCMCDiagnosticTools do not have an implementation of DIC as in R dic.samples(mod2, n.iter=1e3). Backdrop: I am enrolled in a cou…

---

## [How to handle missing values in Turing.jl](https://discourse.julialang.org/t/how-to-handle-missing-values-in-turing-jl/131395)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [August 6, 2025, 6:01pm UTC](https://discourse.julialang.org/t/how-to-handle-missing-values-in-turing-jl/131395 "2025-08-06T18:01:33Z")

</div>

I am attempting a problem where my observed variable (tested\_positive) has missing values. I am wondering how to attempt such a problem using Turing.jl. In my cases I have popn covariates which have no missing values, t…

---

## [Smooth progress bar for multithreads sampling in turing.jl](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 6\
**Last updated:** [July 26, 2025, 1:13pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768 "2025-07-26T13:13:42Z")

</div>

Hello everyone, Im working with turing.jl and what I have noticed that when sampling multiple chains with mulithreads option. Progress bar show progress based on number of chains used for example if I use 3 chains then …

---

## [Set distribution for function parameters](https://discourse.julialang.org/t/set-distribution-for-function-parameters/130963)

<div class="topic-metadata">

**Author:** [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Replies:** 2\
**Last updated:** [July 23, 2025, 2:18pm UTC](https://discourse.julialang.org/t/set-distribution-for-function-parameters/130963 "2025-07-23T14:18:24Z")

</div>

Hi, all. I am stucked by the problems of building a @model for a parameters of a function when using Turing. Such as for function f(x; b, c), I want to obtain a model like @model fuction(x,y) b ~ truncated(Normal(1., 1)…

---

## [Efficient vectorization in Turing.jl](https://discourse.julialang.org/t/efficient-vectorization-in-turing-jl/130390)

<div class="topic-metadata">

**Author:** [@contejuz](https://discourse.julialang.org/u/contejuz)\
**Replies:** 1\
**Last updated:** [July 3, 2025, 3:25pm UTC](https://discourse.julialang.org/t/efficient-vectorization-in-turing-jl/130390 "2025-07-03T15:25:38Z")

</div>

I have a fairly simple hierarchical model where I have 2 population parameters a,b. b is also an individual level parameters such that the b\_i are sampled from a distribution parametrized by b. a and b\_i govern the shape…

---

## [What is the intended use for \`Turing.returned(model)\`?](https://discourse.julialang.org/t/what-is-the-intended-use-for-turing-returned-model/130105)

<div class="topic-metadata">

**Author:** [@lunafazio](https://discourse.julialang.org/u/lunafazio)\
**Replies:** 4\
**Last updated:** [June 30, 2025, 7:16am UTC](https://discourse.julialang.org/t/what-is-the-intended-use-for-turing-returned-model/130105 "2025-06-30T07:16:24Z")

</div>

There are no examples in the documentation, but based on its description, Return a model wrapper indicating that it is a model over its return-values. I assumed that this would allow me to do something like chain = …

---

## [Extracting chains individual initial step size from Turing chain object saved (serialize) after run](https://discourse.julialang.org/t/extracting-chains-individual-initial-step-size-from-turing-chain-object-saved-serialize-after-run/130272)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [June 29, 2025, 8:21am UTC](https://discourse.julialang.org/t/extracting-chains-individual-initial-step-size-from-turing-chain-object-saved-serialize-after-run/130272 "2025-06-29T08:21:55Z")

</div>

Hello, I was wondering is there any way to extract individual step size for chains I run in parallel ? I tried summarize() but it just gives mean and sd value. Thank you

---

## [Slow Turing.jl sampling compared to python pymc](https://discourse.julialang.org/t/slow-turing-jl-sampling-compared-to-python-pymc/130228)

<div class="topic-metadata">

**Author:** [@mahe](https://discourse.julialang.org/u/mahe)\
**Replies:** 7\
**Last updated:** [June 26, 2025, 2:59pm UTC](https://discourse.julialang.org/t/slow-turing-jl-sampling-compared-to-python-pymc/130228 "2025-06-26T14:59:02Z")

</div>

I have a spatial model on a (currently) 5x5 grid, for two variables (total size 3737). And 483 observations for one variables. In this simple setting, I want to work in full space (no space reduction), and model my syste…

[Next page](https://discourse.julialang.org/tag/turing/236.md?match_all_tags=true&page=1&tags%5B%5D=turing)
