# Probabilistic Programming

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

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

**Page:** 5

---

## [Extract Turing model to LogDensityProblems and transform variables](https://discourse.julialang.org/t/extract-turing-model-to-logdensityproblems-and-transform-variables/103201)

<div class="topic-metadata">

**Author:** [@YuvalBernard](https://discourse.julialang.org/u/YuvalBernard)\
**Replies:** 2\
**Last updated:** [August 26, 2023, 7:46am UTC](https://discourse.julialang.org/t/extract-turing-model-to-logdensityproblems-and-transform-variables/103201 "2023-08-26T07:46:57Z")

</div>

Hi all, As some sort of continuation of Recommended way to extract logprob and build gradients in Turing.jl? I wish to extract the log probability density from a Turing model (to use with Pathfider.jl for example), an…

---

## [Numerical stability in Turing.jl](https://discourse.julialang.org/t/numerical-stability-in-turing-jl/103035)

<div class="topic-metadata">

**Author:** [@boogiewoogie](https://discourse.julialang.org/u/boogiewoogie)\
**Replies:** 7\
**Last updated:** [August 23, 2023, 2:56am UTC](https://discourse.julialang.org/t/numerical-stability-in-turing-jl/103035 "2023-08-23T02:56:32Z")

</div>

I went through Computational Tricks with Turing \<br/\> (Non-Centered Parametrization \<br/\> and QR Decomposition), where it’s suggested to decorrelate the posterior in a Bayesian regression model by a QR decomposition of t…

---

## [Bayesian Cognitive Modeling with Turing.jl (Part 2,3)](https://discourse.julialang.org/t/bayesian-cognitive-modeling-with-turing-jl-part-2-3/103002)

<div class="topic-metadata">

**Author:** [@quangtiencs](https://discourse.julialang.org/u/quangtiencs)\
**Replies:** 0\
**Last updated:** [August 20, 2023, 12:05pm UTC](https://discourse.julialang.org/t/bayesian-cognitive-modeling-with-turing-jl-part-2-3/103002 "2023-08-20T12:05:45Z")

</div>

Github: GitHub - quangtiencs/bayesian-cognitive-modeling-with-turing.jl: Bayesian Cognitive Modeling with Turing.jl (Julia Programming Language) Status: All models of these chapters are done: 3, 4, 5, 6 (5/7), 8, 9. I’m…

---

## [How to structure Bayesian model for hiring data based on race, performance, and years of experience](https://discourse.julialang.org/t/how-to-structure-bayesian-model-for-hiring-data-based-on-race-performance-and-years-of-experience/102655)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [August 10, 2023, 1:08pm UTC](https://discourse.julialang.org/t/how-to-structure-bayesian-model-for-hiring-data-based-on-race-performance-and-years-of-experience/102655 "2023-08-10T13:08:01Z")

</div>

I’m working on an analysis of some HR data that is attempting to answer the following question: Do applicants of different races have substantially different probabilities of being selected? For now, I’m focusing on a …

---

## [ERROR: UndefVarError: \`plot\_chains\` not defined](https://discourse.julialang.org/t/error-undefvarerror-plot-chains-not-defined/102641)

<div class="topic-metadata">

**Author:** [@George\_Githinji](https://discourse.julialang.org/u/George_Githinji)\
**Replies:** 0\
**Last updated:** [August 9, 2023, 2:39pm UTC](https://discourse.julialang.org/t/error-undefvarerror-plot-chains-not-defined/102641 "2023-08-09T14:39:41Z")

</div>

I installed Turing and TuringGLM and then ran an example as detailed in the tutorial . However when I ran plot\_chains(chns) , I ran into an issue. ERROR: UndefVarError: \`plot\_chains\` not defined Stacktrace: \[1\] top-le…

---

## [Using Numerical Integration and ApproxFun in Turing.jl](https://discourse.julialang.org/t/using-numerical-integration-and-approxfun-in-turing-jl/101850)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 12\
**Last updated:** [July 21, 2023, 5:13pm UTC](https://discourse.julialang.org/t/using-numerical-integration-and-approxfun-in-turing-jl/101850 "2023-07-21T17:13:09Z")

</div>

I’m trying to write some code to “show how it works” when it comes to imposing high quality prior information on a Bayesian regression problem. I’m running into implementation issues and could use some thoughts @stevengj …

---

## [Get MLE parameters (e.g., p-value, confidence intervals...) from a Turing model using Optim.jl](https://discourse.julialang.org/t/get-mle-parameters-e-g-p-value-confidence-intervals-from-a-turing-model-using-optim-jl/101433)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 3\
**Last updated:** [July 12, 2023, 9:11pm UTC](https://discourse.julialang.org/t/get-mle-parameters-e-g-p-value-confidence-intervals-from-a-turing-model-using-optim-jl/101433 "2023-07-12T21:11:03Z")

</div>

EDIT: There is now PR to add this feature to Turing This might be a very silly question… but assuming the following simple linear model: using Turing using DataFrames using LinearAlgebra x = \[0, 1, 2, 3, 4, 5, 6, 7,…

---

## [VSCode, conda environments, and Stan.jl](https://discourse.julialang.org/t/vscode-conda-environments-and-stan-jl/101271)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 6\
**Last updated:** [July 7, 2023, 7:56pm UTC](https://discourse.julialang.org/t/vscode-conda-environments-and-stan-jl/101271 "2023-07-07T19:56:51Z")

</div>

I have spent the last couple of days trying to get Stan.jl to run with VSCode. Stan.jl requires cmdstan, which (on my platform, Windows) is most easily installed via conda. However, the conda environments seem to be giv…

---

## [How to specify a Turing model to have the 2 vectors as input for a distribution that returns a tuple](https://discourse.julialang.org/t/how-to-specify-a-turing-model-to-have-the-2-vectors-as-input-for-a-distribution-that-returns-a-tuple/100493)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 19\
**Last updated:** [July 1, 2023, 1:23pm UTC](https://discourse.julialang.org/t/how-to-specify-a-turing-model-to-have-the-2-vectors-as-input-for-a-distribution-that-returns-a-tuple/100493 "2023-07-01T13:23:06Z")

</div>

The SequentialSamplingModels.jl package implements distributions that are used in psychology research. One such model, the Linear Ballistic Accumulator (LBA), is used to model simultaneously reaction time (RT) and choice…

---

## [How to recover/access Turing.ADVI parameter names from solution?](https://discourse.julialang.org/t/how-to-recover-access-turing-advi-parameter-names-from-solution/100904)

<div class="topic-metadata">

**Author:** [@Jae\_Choi](https://discourse.julialang.org/u/Jae_Choi)\
**Replies:** 0\
**Last updated:** [June 27, 2023, 5:12pm UTC](https://discourse.julialang.org/t/how-to-recover-access-turing-advi-parameter-names-from-solution/100904 "2023-06-27T17:12:04Z")

</div>

Hi, Experimenting with ADVI and perhaps I just missed this somehow in the documentation, but how does one identify the parameter names (rows) in the output of an ADVI sample? The output of a vi() or rand() sample object…

---

## [Truncated distributions in Gen](https://discourse.julialang.org/t/truncated-distributions-in-gen/50051)

<div class="topic-metadata">

**Author:** [@dell\_parker](https://discourse.julialang.org/u/dell_parker)\
**Replies:** 5\
**Last updated:** [June 23, 2023, 7:49am UTC](https://discourse.julialang.org/t/truncated-distributions-in-gen/50051 "2023-06-23T07:49:05Z")

</div>

Is there a way to sample from a truncated distribution in Gen? In other words, what should go in ?? below? using Gen, Distributions @gen function line\_model(xs::Vector{Float64}) slope = @trace(??, :slope) inte…

---

## [Two equivalent conditioning syntaxes giving different likelihood values?](https://discourse.julialang.org/t/two-equivalent-conditioning-syntaxes-giving-different-likelihood-values/100320)

<div class="topic-metadata">

**Author:** [@BatyLeo](https://discourse.julialang.org/u/BatyLeo)\
**Replies:** 4\
**Last updated:** [June 21, 2023, 1:45pm UTC](https://discourse.julialang.org/t/two-equivalent-conditioning-syntaxes-giving-different-likelihood-values/100320 "2023-06-21T13:45:51Z")

</div>

Hello, I’m new to Turing.j,l and probabilistic programming in general. While playing around with small example codes, I faced a behaviour I don’t understand about the conditioning syntax: If I understand well, these t…

---

## [Speed up multilevel model in Turing.jl](https://discourse.julialang.org/t/speed-up-multilevel-model-in-turing-jl/100201)

<div class="topic-metadata">

**Author:** [@JanG](https://discourse.julialang.org/u/JanG)\
**Replies:** 15\
**Last updated:** [June 17, 2023, 7:40pm UTC](https://discourse.julialang.org/t/speed-up-multilevel-model-in-turing-jl/100201 "2023-06-17T19:40:44Z")

</div>

Hi everybody, I’ve coded up a multilevel model with random intercepts and slopes in Turing (see below). However, my model is very slow compared to similar models in Stan. Does anybody have any insights on how to speed t…

---

## [Error due to Dirichlet prior in Turing?](https://discourse.julialang.org/t/error-due-to-dirichlet-prior-in-turing/100244)

<div class="topic-metadata">

**Author:** [@JanG](https://discourse.julialang.org/u/JanG)\
**Replies:** 9\
**Last updated:** [June 16, 2023, 11:56am UTC](https://discourse.julialang.org/t/error-due-to-dirichlet-prior-in-turing/100244 "2023-06-16T11:56:49Z")

</div>

Hi, This model below crashes for me with the error message LoadError: DomainError with Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}}(NaN,NaN,NaN): Bernoulli: the condition zero(p) \<= p \<= one(p) is not satisfied. us…

---

## [Resume chains Turing](https://discourse.julialang.org/t/resume-chains-turing/66282)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 12\
**Last updated:** [June 9, 2023, 8:13am UTC](https://discourse.julialang.org/t/resume-chains-turing/66282 "2023-06-09T08:13:21Z")

</div>

Hi to everybody, I want to use Turing on the lsf cluster of my university. Following the official documentation and using the ClusterManager package I was able to run Turing on my cluster. using Turing using Distribute…

---

## [New Theoretical Analysis for ADVI / BBVI](https://discourse.julialang.org/t/new-theoretical-analysis-for-advi-bbvi/99527)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)\
**Replies:** 10\
**Last updated:** [May 31, 2023, 1:37am UTC](https://discourse.julialang.org/t/new-theoretical-analysis-for-advi-bbvi/99527 "2023-05-31T01:37:38Z")

</div>

Hi all, We’ve recently uploaded to ArXiv a theoretical analysis for ADVI (although the title says black-box VI), which I believe is the first formal full convergence proof for any black-box VI-type algorithm that uses S…

---

## [Turing checkpointing by callbacks](https://discourse.julialang.org/t/turing-checkpointing-by-callbacks/99293)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 0\
**Last updated:** [May 23, 2023, 3:42pm UTC](https://discourse.julialang.org/t/turing-checkpointing-by-callbacks/99293 "2023-05-23T15:42:28Z")

</div>

How does one save a chain via callbacks in Turing? Right now, I have something like: function checkpoint(rng, model, sampler, sample, state, i; kwargs...) if i % 1000 == 0 serialize("testchainfull$i", chn) …

---

## [Simple question about priors in bayesian analysis](https://discourse.julialang.org/t/simple-question-about-priors-in-bayesian-analysis/97255)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 4\
**Last updated:** [May 23, 2023, 3:00pm UTC](https://discourse.julialang.org/t/simple-question-about-priors-in-bayesian-analysis/97255 "2023-05-23T15:00:12Z")

</div>

Hello. Imagine I want to use a small dataset (from an experiment) to fit a bayesian model. Is it right if I first apply that model to a large dataset (such as the public health service) and use the output as the prior …

---

## [Chains vs iterations behavior in Turing sampler (conditional priors)](https://discourse.julialang.org/t/chains-vs-iterations-behavior-in-turing-sampler-conditional-priors/99165)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 8\
**Last updated:** [May 21, 2023, 9:02pm UTC](https://discourse.julialang.org/t/chains-vs-iterations-behavior-in-turing-sampler-conditional-priors/99165 "2023-05-21T21:02:51Z")

</div>

I wrote a simple model that looks like this: @model function stam() # Prior distributions op = \[1.0, 2.0, 3.0, 4.0\] α ~ DiscreteUniform(1, length(op)) β ~ truncated(Normal(op\[α\] , 0.1); lower=0.01, upper=10.0)…

---

## [Probablistic modeling of multiagent systems?](https://discourse.julialang.org/t/probablistic-modeling-of-multiagent-systems/95689)

<div class="topic-metadata">

**Author:** [@DanielV](https://discourse.julialang.org/u/DanielV)\
**Replies:** 5\
**Last updated:** [May 21, 2023, 12:44pm UTC](https://discourse.julialang.org/t/probablistic-modeling-of-multiagent-systems/95689 "2023-05-21T12:44:14Z")

</div>

I have a simple agents.jl sim where at each step with some probability agents are added or change state or are removed. Agents are not independent, e.g., there is a finite “capacity” resource which might prevent an agent…

---

## [Implementing Gibbs sampler for ODE parameter estimation](https://discourse.julialang.org/t/implementing-gibbs-sampler-for-ode-parameter-estimation/99132)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 2\
**Last updated:** [May 20, 2023, 8:58pm UTC](https://discourse.julialang.org/t/implementing-gibbs-sampler-for-ode-parameter-estimation/99132 "2023-05-20T20:58:14Z")

</div>

I would like to use a Gibbs sampler for a model that looks like this (in Turing.jl): @model function fit\_burger2(data::AbstractVector, prob) # Prior distributions σᵣ = 1.5e6 Aₘ ~ truncated(Normal(0.1, 0.05); lo…

---

## [MethodError in Turing.jl](https://discourse.julialang.org/t/methoderror-in-turing-jl/99075)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 2\
**Last updated:** [May 19, 2023, 6:41pm UTC](https://discourse.julialang.org/t/methoderror-in-turing-jl/99075 "2023-05-19T18:41:28Z")

</div>

I’m trying to do a Bayesian inference to the following ODE system: function ice(du, u, p, t) εₘ, εₖ, σ, F, d, ε = u Aₘ, Qₘ, n, pₘ, R, T, Eₖ, Eₘ, η, dₛₛ, Fₛₛ, ε₁, ε₂, S = p du\[1\] = Aₘ \* (σ/F)^n \* d^(-pₘ) \* ℯ^(-Qₘ/(…

---

## [Help converting Jags.jl example to Turing](https://discourse.julialang.org/t/help-converting-jags-jl-example-to-turing/98718)

<div class="topic-metadata">

**Author:** [@mkaut](https://discourse.julialang.org/u/mkaut)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 12:57pm UTC](https://discourse.julialang.org/t/help-converting-jags-jl-example-to-turing/98718 "2023-05-18T12:57:28Z")

</div>

I want to start using Turing and decided to learn it by converting an example from Jags.jl (which I have used before). I have selected the ‘rats’ example from Jags.jl for the test. I have a working code, but 2 issues th…

---

## [Error Running Simple Gaussian Demo - Turing.jl](https://discourse.julialang.org/t/error-running-simple-gaussian-demo-turing-jl/97553)

<div class="topic-metadata">

**Author:** [@joshuaderekwhite](https://discourse.julialang.org/u/joshuaderekwhite)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 3:21am UTC](https://discourse.julialang.org/t/error-running-simple-gaussian-demo-turing-jl/97553 "2023-05-18T03:21:08Z")

</div>

Hello, I am trying to run the Simple Gaussian Demo found here: https://turing.ml/v0.22/docs/using-turing/guide. I have copied the gdemo model as written as well as c1-c6. c1 and c2 run without any errors, however for c3…

---

## [INLA.jl implementation help](https://discourse.julialang.org/t/inla-jl-implementation-help/98958)

<div class="topic-metadata">

**Author:** [@bparbhu](https://discourse.julialang.org/u/bparbhu)\
**Replies:** 4\
**Last updated:** [May 17, 2023, 7:23pm UTC](https://discourse.julialang.org/t/inla-jl-implementation-help/98958 "2023-05-17T19:23:53Z")

</div>

So I started trying to reverse engineer this comparison done in R that performs a very close implementation of INLA from scratch. Though, I’m having difficulty reproducing the results of the “from-scratch” implementation…

---

## [Bayesian Neural Network example in Turing](https://discourse.julialang.org/t/bayesian-neural-network-example-in-turing/98667)

<div class="topic-metadata">

**Author:** [@Patrik\_Waldmann](https://discourse.julialang.org/u/Patrik_Waldmann)\
**Replies:** 0\
**Last updated:** [May 11, 2023, 8:55am UTC](https://discourse.julialang.org/t/bayesian-neural-network-example-in-turing/98667 "2023-05-11T08:55:47Z")

</div>

I have run the Bayesian Neural Networks example in the Turing Tutorials and it works fine except for that the network weights (parameters variable) run into identifiability/convergence issues, i.e. most of them wanders a…

---

## [GPs: sum of independent Kernels](https://discourse.julialang.org/t/gps-sum-of-independent-kernels/98542)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 8:00am UTC](https://discourse.julialang.org/t/gps-sum-of-independent-kernels/98542 "2023-05-10T08:00:58Z")

</div>

The documentation of KernelFunctions.jl specifies many building blocks to define composite Kernels. But I can’t find a way to build a sum of independent Kernels, something similar to the KernelTensorProduct but with addi…

---

## [Probabilistic forecasting for spatio-temporal raster data](https://discourse.julialang.org/t/probabilistic-forecasting-for-spatio-temporal-raster-data/98436)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 2\
**Last updated:** [May 7, 2023, 6:44pm UTC](https://discourse.julialang.org/t/probabilistic-forecasting-for-spatio-temporal-raster-data/98436 "2023-05-07T18:44:19Z")

</div>

We have a time series gridded/ratser panel dataset (spatio-temporal). The dataset is in 3D, where each ((x, y, t), where x and y ranges from 1-25 while t ranges from 1-1800 though we’re trying to predict just the next ti…

---

## [Turing conditioning syntax and models using @addlogprob!](https://discourse.julialang.org/t/turing-conditioning-syntax-and-models-using-addlogprob/85196)

<div class="topic-metadata">

**Author:** [@SebastianCallh](https://discourse.julialang.org/u/SebastianCallh)\
**Replies:** 6\
**Last updated:** [May 1, 2023, 8:55pm UTC](https://discourse.julialang.org/t/turing-conditioning-syntax-and-models-using-addlogprob/85196 "2023-05-01T20:55:49Z")

</div>

Hello! It is my understanding the preferred syntax to provide observations to Turing models going forward is to make use of the condition operator model() | (;y) instead of explicitly passing the observations model(y). H…

---

## [Problem using Turing in Jupyter](https://discourse.julialang.org/t/problem-using-turing-in-jupyter/97624)

<div class="topic-metadata">

**Author:** [@alexdmeyer](https://discourse.julialang.org/u/alexdmeyer)\
**Replies:** 1\
**Last updated:** [April 19, 2023, 10:44pm UTC](https://discourse.julialang.org/t/problem-using-turing-in-jupyter/97624 "2023-04-19T22:44:20Z")

</div>

Hi Julia folks, I’m running into a strange issue using Turing.jl. I do most of my work in Atom, where Turing works just fine. However, recently I’ve been getting the following error below upon running using Turing in Ju…

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

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