# Probabilistic Programming

**URL:** https://discourse.julialang.org/c/domain/probprog/48.md?page=1

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

**Page:** 2

---

## [Solving inference problem in quantum error correction with Turing.jl](https://discourse.julialang.org/t/solving-inference-problem-in-quantum-error-correction-with-turing-jl/129753)

<div class="topic-metadata">

**Author:** [@nzy1997](https://discourse.julialang.org/u/nzy1997)\
**Replies:** 4\
**Last updated:** [June 11, 2025, 8:17am UTC](https://discourse.julialang.org/t/solving-inference-problem-in-quantum-error-correction-with-turing-jl/129753 "2025-06-11T08:17:54Z")

</div>

Hi everyone, I am trying to use Turing.jl to solve an inference problem in quantum error correction. Here is a simple problem. Problem Statement: Consider a parity check bit c \\in \\{0,1\\} computed from four binary var…

---

## [TuringGLM.jl and offsets / exposure](https://discourse.julialang.org/t/turingglm-jl-and-offsets-exposure/129772)

<div class="topic-metadata">

**Author:** [@DrEntropy](https://discourse.julialang.org/u/DrEntropy)\
**Replies:** 1\
**Last updated:** [June 10, 2025, 8:31am UTC](https://discourse.julialang.org/t/turingglm-jl-and-offsets-exposure/129772 "2025-06-10T08:31:38Z")

</div>

The roaches example, Poisson Regression · TuringGLM.jl ignores the exposure. In BRMS this is done using a formula term like this " … + offset(log(exposure))\` . GLM.jl handles this with an extra argument to the call.…

---

## [Performance issue with Turing (but not Optimization)](https://discourse.julialang.org/t/performance-issue-with-turing-but-not-optimization/129611)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 9\
**Last updated:** [June 4, 2025, 7:35pm UTC](https://discourse.julialang.org/t/performance-issue-with-turing-but-not-optimization/129611 "2025-06-04T19:35:14Z")

</div>

Hello all Turing experts. I am having a vexing issue with using NUTS sampling to sample from the posterior of a semi-complicated model involving ODE’s. This is a performance issue that I can’t track down. Unfortunately I…

---

## [Keep it simple stupid vs PPLs like Turing](https://discourse.julialang.org/t/keep-it-simple-stupid-vs-ppls-like-turing/129452)

<div class="topic-metadata">

**Author:** [@nomadbl](https://discourse.julialang.org/u/nomadbl)\
**Replies:** 5\
**Last updated:** [June 2, 2025, 1:13am UTC](https://discourse.julialang.org/t/keep-it-simple-stupid-vs-ppls-like-turing/129452 "2025-06-02T01:13:52Z")

</div>

Hello everyone. I come from a general Machine Learning and Neural Networks background and learned about probabilistic programming and Bayesian Inference in the last year. Naturally I wanted to see what was available in …

---

## [Propagate posterior samples from model calibration as the prior into an inverse problem](https://discourse.julialang.org/t/propagate-posterior-samples-from-model-calibration-as-the-prior-into-an-inverse-problem/128844)

<div class="topic-metadata">

**Author:** [@Cory\_Simon](https://discourse.julialang.org/u/Cory_Simon)\
**Replies:** 5\
**Last updated:** [May 11, 2025, 6:52pm UTC](https://discourse.julialang.org/t/propagate-posterior-samples-from-model-calibration-as-the-prior-into-an-inverse-problem/128844 "2025-05-11T18:52:16Z")

</div>

so I have a model y = f(x; \\theta). using (x, y) pairs, I get a posterior over theta. this constitutes “model calibration”. now I wanna use this posterior as the prior for an inverse problem, where I observe y and wann…

---

## [Turing.jl programmatically set number of clusters in a mixture model](https://discourse.julialang.org/t/turing-jl-programmatically-set-number-of-clusters-in-a-mixture-model/126170)

<div class="topic-metadata">

**Author:** [@apattyn](https://discourse.julialang.org/u/apattyn)\
**Replies:** 6\
**Last updated:** [May 10, 2025, 12:52pm UTC](https://discourse.julialang.org/t/turing-jl-programmatically-set-number-of-clusters-in-a-mixture-model/126170 "2025-05-10T12:52:05Z")

</div>

I am trying to model some data using a mixture model with Turing.jl, but I want to programmatically set the number of Gaussian in the mixture without having to edit the model. For example if I want ten Gaussians I don’t …

---

## [Singular Exception with LKJCholesky](https://discourse.julialang.org/t/singular-exception-with-lkjcholesky/85020)

<div class="topic-metadata">

**Author:** [@joshualeond](https://discourse.julialang.org/u/joshualeond)\
**Replies:** 24\
**Last updated:** [April 25, 2025, 4:41pm UTC](https://discourse.julialang.org/t/singular-exception-with-lkjcholesky/85020 "2025-04-25T16:41:08Z")

</div>

Hi there, I’ve seen the recent development for the LKJCholesky implementations within Distributions.jl and am attempting to put it to use within Turing.jl. I understand that Turing.jl doesn’t yet support Cholesky Variat…

---

## [How to sample many ordered iid variables in turing](https://discourse.julialang.org/t/how-to-sample-many-ordered-iid-variables-in-turing/127205)

<div class="topic-metadata">

**Author:** [@swsw](https://discourse.julialang.org/u/swsw)\
**Replies:** 2\
**Last updated:** [March 24, 2025, 2:34pm UTC](https://discourse.julialang.org/t/how-to-sample-many-ordered-iid-variables-in-turing/127205 "2025-03-24T14:34:56Z")

</div>

Hi there, I’d like to sample many ordered iid varialbles but i find when the number of samples is large the efficiency gets very low. For the subsequent code it works when the number of variables is 30 or so but not whe…

---

## [Help -- can't get Turing to work on a simple model](https://discourse.julialang.org/t/help-cant-get-turing-to-work-on-a-simple-model/122107)

<div class="topic-metadata">

**Author:** [@anprasad](https://discourse.julialang.org/u/anprasad)\
**Replies:** 6\
**Last updated:** [March 19, 2025, 2:50pm UTC](https://discourse.julialang.org/t/help-cant-get-turing-to-work-on-a-simple-model/122107 "2025-03-19T14:50:34Z")

</div>

Hi everyone, I’m new to Bayesian inference and Turing, so I realize that this is likely user error more than anything. I’m trying to fit a simple model; I’ve tried two versions here @model function model1(samples) …

---

## [Turing.jl + Enyzme Examples](https://discourse.julialang.org/t/turing-jl-enyzme-examples/121606)

<div class="topic-metadata">

**Author:** [@joshualeond](https://discourse.julialang.org/u/joshualeond)\
**Replies:** 4\
**Last updated:** [March 19, 2025, 9:48am UTC](https://discourse.julialang.org/t/turing-jl-enyzme-examples/121606 "2025-03-19T09:48:19Z")

</div>

Hi there, are there any working examples of using Turing.jl with the Enzyme.jl AD backend? I’ve seen several Github issues like this one but I think they may be outdated at this point. Also the following Discourse topic…

---

## [Bayesian inference of the area profile of a solid in a draining tank using Turing.jl](https://discourse.julialang.org/t/bayesian-inference-of-the-area-profile-of-a-solid-in-a-draining-tank-using-turing-jl/126995)

<div class="topic-metadata">

**Author:** [@Cory\_Simon](https://discourse.julialang.org/u/Cory_Simon)\
**Replies:** 2\
**Last updated:** [March 16, 2025, 4:43pm UTC](https://discourse.julialang.org/t/bayesian-inference-of-the-area-profile-of-a-solid-in-a-draining-tank-using-turing-jl/126995 "2025-03-16T16:43:35Z")

</div>

:waving\_hand: I am a chemical engineering professor at Oregon State University. we used Turing.jl to solve an inverse problem of reconstruction with quantified uncertainty: infer the horizontal cross-sectional area profi…

---

## [Understanding the correct syntax for fitting models with Turing.jl](https://discourse.julialang.org/t/understanding-the-correct-syntax-for-fitting-models-with-turing-jl/126945)

<div class="topic-metadata">

**Author:** [@Matt\_jl](https://discourse.julialang.org/u/Matt_jl)\
**Replies:** 4\
**Last updated:** [March 15, 2025, 9:09pm UTC](https://discourse.julialang.org/t/understanding-the-correct-syntax-for-fitting-models-with-turing-jl/126945 "2025-03-15T21:09:46Z")

</div>

Hi everyone, I’m trying to learn how to use Turing.jl to fit models to observational data, but I find the syntax somewhat confusing, and the documentation isn’t very beginner-friendly when it comes to real-world example…

---

## [RxInfer.jl beginner question re; UndefRefError](https://discourse.julialang.org/t/rxinfer-jl-beginner-question-re-undefreferror/126660)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 6\
**Last updated:** [March 9, 2025, 8:29pm UTC](https://discourse.julialang.org/t/rxinfer-jl-beginner-question-re-undefreferror/126660 "2025-03-09T20:29:21Z")

</div>

Hi all, I just started with RxInfer.jl for simulations of patient recruitment in clinical trials. The simplest model is a simple Poisson-Gamma model, where each clinical site draws the (time homogeneous) rate for the Poi…

---

## [Turing.jl/MCMC: Chains getting stuck](https://discourse.julialang.org/t/turing-jl-mcmc-chains-getting-stuck/77696)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 9\
**Last updated:** [January 30, 2025, 12:47pm UTC](https://discourse.julialang.org/t/turing-jl-mcmc-chains-getting-stuck/77696 "2025-01-30T12:47:00Z")

</div>

I want ask for advice or insight as to why my MCMC chains could be stuck even when using HMC on a uni-modal posterior. I’m doing parameter calibration of pedestrian models (systems of non-linear ODEs) using Turing.jl. I…

---

## [Advice speeding up a turing model](https://discourse.julialang.org/t/advice-speeding-up-a-turing-model/124741)

<div class="topic-metadata">

**Author:** [@jacques1](https://discourse.julialang.org/u/jacques1)\
**Replies:** 7\
**Last updated:** [January 14, 2025, 7:20pm UTC](https://discourse.julialang.org/t/advice-speeding-up-a-turing-model/124741 "2025-01-14T19:20:49Z")

</div>

I have a model in Turing which is exceptionally slow and am hoping for some help speeding it up. I am new to Turing so any pointers are helpful. My model is @model function many\_linreg(X, y; predictors=size(X, 2)) …

---

## [US elections model implementation in Turing](https://discourse.julialang.org/t/us-elections-model-implementation-in-turing/49864)

<div class="topic-metadata">

**Author:** [@entr0pidelic](https://discourse.julialang.org/u/entr0pidelic)\
**Replies:** 4\
**Last updated:** [January 12, 2025, 4:01pm UTC](https://discourse.julialang.org/t/us-elections-model-implementation-in-turing/49864 "2025-01-12T16:01:39Z")

</div>

Hello guys, hope you are doing well. I am trying to implement the US forecasting election model from the paper by Linzer https://www.ime.usp.br/~abe/lista/pdfpWRrt4xFLt.pdf, and it would be great if someone could give m…

---

## [Parameter inference with Turing with Observed Distribution](https://discourse.julialang.org/t/parameter-inference-with-turing-with-observed-distribution/123065)

<div class="topic-metadata">

**Author:** [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Replies:** 2\
**Last updated:** [December 9, 2024, 9:08pm UTC](https://discourse.julialang.org/t/parameter-inference-with-turing-with-observed-distribution/123065 "2024-12-09T21:08:57Z")

</div>

Lets say I have a model using Turing, StatsPlots @model function model(a) p ~ Normal(1,1) a ~ Normal(p,1) end and I do an experiment and I observe a to be equal to 1.5: Then I can update my prior believe rega…

---

## [Alert! Error while slicing](https://discourse.julialang.org/t/alert-error-while-slicing/123439)

<div class="topic-metadata">

**Author:** [@govindanupam](https://discourse.julialang.org/u/govindanupam)\
**Replies:** 5\
**Last updated:** [December 5, 2024, 8:57am UTC](https://discourse.julialang.org/t/alert-error-while-slicing/123439 "2024-12-05T08:57:29Z")

</div>

using FileIO using GeometryBasics using MeshIO Load the STL file input\_file = “C:\\Users\\OMG\\Desktop\\3D model\\square.stl” mesh = FileIO.load(input\_file) Define a slicing plane (e.g., Z = 0.5) slice\_plane\_z = 0.5 Fun…

---

## [Parameter Estimation with partial data](https://discourse.julialang.org/t/parameter-estimation-with-partial-data/123192)

<div class="topic-metadata">

**Author:** [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Replies:** 2\
**Last updated:** [November 28, 2024, 8:35am UTC](https://discourse.julialang.org/t/parameter-estimation-with-partial-data/123192 "2024-11-28T08:35:35Z")

</div>

Hi, I have a differential equation, for example the differential equation for a pendulum, like in this example from DiffEqBayes. I would like to estimate the parameters. However I only know a part of the solution, for …

---

## [Logistic regression for data with missing values](https://discourse.julialang.org/t/logistic-regression-for-data-with-missing-values/122929)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 1\
**Last updated:** [November 22, 2024, 9:34am UTC](https://discourse.julialang.org/t/logistic-regression-for-data-with-missing-values/122929 "2024-11-22T09:34:05Z")

</div>

:100: ello I tried to adapt logistic regression for my case @model function logistic\_regression(x, y, n, σ) intercept ~ Normal(0, σ) Gabel ~ Normal(0, σ) SUVmax\_binned ~ Normal(0, σ) MTV\_binned ~ Normal…

---

## [Get list of parameters from Turing model](https://discourse.julialang.org/t/get-list-of-parameters-from-turing-model/66278)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 16\
**Last updated:** [November 14, 2024, 10:50pm UTC](https://discourse.julialang.org/t/get-list-of-parameters-from-turing-model/66278 "2024-11-14T22:50:09Z")

</div>

How can I get the list of parameters in a Turing model? I’m trying to generate programmatically a list of initial values to pass with init\_params, so I need to know the symbols, in the correct order. For example, given…

---

## [Non-converging chains and slow runtime in Bayesian parameter estimation for wind turbine system](https://discourse.julialang.org/t/non-converging-chains-and-slow-runtime-in-bayesian-parameter-estimation-for-wind-turbine-system/122416)

<div class="topic-metadata">

**Author:** [@Alvaro98](https://discourse.julialang.org/u/Alvaro98)\
**Replies:** 7\
**Last updated:** [November 13, 2024, 7:02pm UTC](https://discourse.julialang.org/t/non-converging-chains-and-slow-runtime-in-bayesian-parameter-estimation-for-wind-turbine-system/122416 "2024-11-13T19:02:44Z")

</div>

Hello all, I’m quite new to Turing and Bayesian inference in general, and I’m trying to estimate parameters for the power coefficient Cp in a wind turbine aerodynamic model. The parametric expression for Cp has 6 parame…

---

## [Turing - "Automatic" Non-Centered Distribution Types](https://discourse.julialang.org/t/turing-automatic-non-centered-distribution-types/122598)

<div class="topic-metadata">

**Author:** [@farr](https://discourse.julialang.org/u/farr)\
**Replies:** 0\
**Last updated:** [November 13, 2024, 3:52pm UTC](https://discourse.julialang.org/t/turing-automatic-non-centered-distribution-types/122598 "2024-11-13T15:52:28Z")

</div>

Hi Folks, I experimented a bit today with some “automatic” non-centered Normal distributions this morning, and I think I have something that works quite well. Many experts know about the trick to replace mu ~ \<mu prio…

---

## [TuringGLM random effect variable format requirement](https://discourse.julialang.org/t/turingglm-random-effect-variable-format-requirement/122424)

<div class="topic-metadata">

**Author:** [@Cong](https://discourse.julialang.org/u/Cong)\
**Replies:** 0\
**Last updated:** [November 8, 2024, 4:20pm UTC](https://discourse.julialang.org/t/turingglm-random-effect-variable-format-requirement/122424 "2024-11-08T16:20:08Z")

</div>

I’m using TuringGLM to fit a hierarchical logistic model on my choice data, but kept getting this type FunctionTerm has no field args error which I think complains about the variable type of my random effect variable sub…

---

## [Sampling from custom distribution: "No method matching iterate..."](https://discourse.julialang.org/t/sampling-from-custom-distribution-no-method-matching-iterate/121925)

<div class="topic-metadata">

**Author:** [@alexdmeyer](https://discourse.julialang.org/u/alexdmeyer)\
**Replies:** 5\
**Last updated:** [October 29, 2024, 10:24pm UTC](https://discourse.julialang.org/t/sampling-from-custom-distribution-no-method-matching-iterate/121925 "2024-10-29T22:24:10Z")

</div>

Hello fellow Julians, I’m trying to use a custom distribution/sampleable for inference in Turing.jl, and I’ve encountered a problem I can’t solve. Following the instructions on the Turing docs, I made the following mini…

---

## [Posterior samples as vector of named tuples](https://discourse.julialang.org/t/posterior-samples-as-vector-of-named-tuples/121430)

<div class="topic-metadata">

**Author:** [@bertschi](https://discourse.julialang.org/u/bertschi)\
**Replies:** 3\
**Last updated:** [October 21, 2024, 7:00pm UTC](https://discourse.julialang.org/t/posterior-samples-as-vector-of-named-tuples/121430 "2024-10-21T19:00:20Z")

</div>

Let’s say I have a simple Turing model @model function model() C ~ LKJ(3, 1.0) x ~ MvNormal(zeros(3), C) end and obtained some posterior samples via MCMC chain = sample(model(), NUTS(), 100) or variational in…

---

## [Issues when using Turing with DynamicHMC](https://discourse.julialang.org/t/issues-when-using-turing-with-dynamichmc/31127)

<div class="topic-metadata">

**Author:** [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Replies:** 9\
**Last updated:** [October 14, 2024, 8:35pm UTC](https://discourse.julialang.org/t/issues-when-using-turing-with-dynamichmc/31127 "2024-10-14T20:35:16Z")

</div>

Hi, when I try to run the DynamicNUTS example from the documentation upon loading the libraries (and having installed current versions) the below issues occur: Warning: Error requiring LogDensityProblems from Turing: U…

---

## [Adding uncertainty on timestep of Bayesian ODE solve through \`saveat\`](https://discourse.julialang.org/t/adding-uncertainty-on-timestep-of-bayesian-ode-solve-through-saveat/120424)

<div class="topic-metadata">

**Author:** [@japhir](https://discourse.julialang.org/u/japhir)\
**Replies:** 9\
**Last updated:** [October 1, 2024, 5:11am UTC](https://discourse.julialang.org/t/adding-uncertainty-on-timestep-of-bayesian-ode-solve-through-saveat/120424 "2024-10-01T05:11:17Z")

</div>

I’d like to do a Bayesian inversion of parameters to an ODE model. I would like to add some uncertainty on the input time series. Is there any way to do this? I’ve tried to add a parameter tau ~ Uniform(-60, 60) and used…

---

## [Performance issues with Turing and NUTS](https://discourse.julialang.org/t/performance-issues-with-turing-and-nuts/119749)

<div class="topic-metadata">

**Author:** [@Benjamin\_Zanger](https://discourse.julialang.org/u/Benjamin_Zanger)\
**Replies:** 4\
**Last updated:** [September 24, 2024, 10:08pm UTC](https://discourse.julialang.org/t/performance-issues-with-turing-and-nuts/119749 "2024-09-24T22:08:16Z")

</div>

Hello, I am new to Turing and try to do MCMC sampling from a simple linear forward model with gaussian prior. I got the following model: A = randn(20, 1000) m = size(A, 1) n = size(A, 2) x\_true = randn(n) σ\_prior = 0…

---

## [Conditional MH() proposals fail to accept (simplified question)](https://discourse.julialang.org/t/conditional-mh-proposals-fail-to-accept-simplified-question/119531)

<div class="topic-metadata">

**Author:** [@aws](https://discourse.julialang.org/u/aws)\
**Replies:** 1\
**Last updated:** [September 22, 2024, 9:48pm UTC](https://discourse.julialang.org/t/conditional-mh-proposals-fail-to-accept-simplified-question/119531 "2024-09-22T21:48:48Z")

</div>

Hello, I am attempting to perform Gibbs sampling using a mixture of close formed conditional posteriors and other samplers. Ultimately, I will use this to estimate parameters in a nonlinear model where I can write out t…

[Previous page](https://discourse.julialang.org/c/domain/probprog/48.md)

[Next page](https://discourse.julialang.org/c/domain/probprog/48.md?page=2)
