# Probabilistic Programming

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

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

**Page:** 4

---

## [Ordinal probit model with Turing - difficulty sampling](https://discourse.julialang.org/t/ordinal-probit-model-with-turing-difficulty-sampling/112528)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 4\
**Last updated:** [April 9, 2024, 1:43pm UTC](https://discourse.julialang.org/t/ordinal-probit-model-with-turing-difficulty-sampling/112528 "2024-04-09T13:43:58Z")

</div>

I am trying to use Turing to estimate an ordinal multinomial model with partially fixed thresholds/cutpoints, but I’m wondering if I’m doing something wrong: metropolis-hastings sampling works great, but the autodiff-bas…

---

## [Turing.jl Bayesian SDE tutorial doesn't sample posterior chain](https://discourse.julialang.org/t/turing-jl-bayesian-sde-tutorial-doesnt-sample-posterior-chain/112592)

<div class="topic-metadata">

**Author:** [@anprasad](https://discourse.julialang.org/u/anprasad)\
**Replies:** 0\
**Last updated:** [April 6, 2024, 1:02am UTC](https://discourse.julialang.org/t/turing-jl-bayesian-sde-tutorial-doesnt-sample-posterior-chain/112592 "2024-04-06T01:02:32Z")

</div>

The parameter inference of the SDE in the Turing.jl tutorial doesn’t sample the posterior. Is this an error?

---

## [Turing: Posterior Prediction](https://discourse.julialang.org/t/turing-posterior-prediction/111072)

<div class="topic-metadata">

**Author:** [@Sam\_P](https://discourse.julialang.org/u/Sam_P)\
**Replies:** 6\
**Last updated:** [April 5, 2024, 3:22pm UTC](https://discourse.julialang.org/t/turing-posterior-prediction/111072 "2024-04-05T15:22:36Z")

</div>

Hi, I’ve been trying to use the predict function in Turing for Posterior Prediction as per here: https://discourse.julialang.org/t/ann-turing-0-13-0-mle-map-and-prediction/40033#prediction-2 Based on that, I tried appl…

---

## [Turing.jl for geophysical applications](https://discourse.julialang.org/t/turing-jl-for-geophysical-applications/107197)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 5\
**Last updated:** [March 29, 2024, 1:29pm UTC](https://discourse.julialang.org/t/turing-jl-for-geophysical-applications/107197 "2024-03-29T13:29:07Z")

</div>

Hello everyone. I am writing this post with the hope that It helps people with background in physics, and want to learn about probabilistic programming using Turing.jl. My background is geophysics, and I only have a cou…

---

## [Hamiltonian Monte Carlo gets stuck at tiny local maxima](https://discourse.julialang.org/t/hamiltonian-monte-carlo-gets-stuck-at-tiny-local-maxima/108389)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 14\
**Last updated:** [March 18, 2024, 6:22pm UTC](https://discourse.julialang.org/t/hamiltonian-monte-carlo-gets-stuck-at-tiny-local-maxima/108389 "2024-03-18T18:22:40Z")

</div>

Hello! This is my first time trying to perform Bayesian inference, and I have found some problematic behavior when using Hamiltonian Monte Carlo. I’d like some help in figuring out what may be going wrong. I have a like…

---

## [Citation for Turing.jl](https://discourse.julialang.org/t/citation-for-turing-jl/111288)

<div class="topic-metadata">

**Author:** [@pfarndt](https://discourse.julialang.org/u/pfarndt)\
**Replies:** 1\
**Last updated:** [March 7, 2024, 12:41pm UTC](https://discourse.julialang.org/t/citation-for-turing-jl/111288 "2024-03-07T12:41:29Z")

</div>

In our research we heavily use Turing.jl and ForwardDiff.jl. Without these packages we would not have succeeded. Is there a publication we could cite in an upcoming publication to give some credits?

---

## [Turing.jl - Create priors dynamically](https://discourse.julialang.org/t/turing-jl-create-priors-dynamically/110587)

<div class="topic-metadata">

**Author:** [@Rafalel\_Jupio](https://discourse.julialang.org/u/Rafalel_Jupio)\
**Replies:** 2\
**Last updated:** [March 1, 2024, 3:22pm UTC](https://discourse.julialang.org/t/turing-jl-create-priors-dynamically/110587 "2024-03-01T15:22:34Z")

</div>

Hello everyone, So in the problem I am currently working on, my parameter space changes a lot, meaning the number of parameters I want to make inference on (using Bayesian statistics, through the Turing.jl package) is n…

---

## [Turing support for exact inference (over discrete supports)](https://discourse.julialang.org/t/turing-support-for-exact-inference-over-discrete-supports/70533)

<div class="topic-metadata">

**Author:** [@jmuchovej](https://discourse.julialang.org/u/jmuchovej)\
**Replies:** 2\
**Last updated:** [February 8, 2024, 12:29pm UTC](https://discourse.julialang.org/t/turing-support-for-exact-inference-over-discrete-supports/70533 "2024-02-08T12:29:16Z")

</div>

I’m working on a “Rational Speech Acts” (RSA) model. Essentially, RSA is a recursive process where you call distributions over states of the world or utterances made. So, in this case I have the following setup: functi…

---

## [ForwardDiff.jl returns NaNs for calculating gradient of simulation model](https://discourse.julialang.org/t/forwarddiff-jl-returns-nans-for-calculating-gradient-of-simulation-model/109796)

<div class="topic-metadata">

**Author:** [@fnoessler](https://discourse.julialang.org/u/fnoessler)\
**Replies:** 2\
**Last updated:** [February 8, 2024, 12:45pm UTC](https://discourse.julialang.org/t/forwarddiff-jl-returns-nans-for-calculating-gradient-of-simulation-model/109796 "2024-02-08T12:45:28Z")

</div>

Hello, this is a follow up post to Differential evolution MCMC in Julia? I want to try HMC/Nuts (via DynamicHMC.jl or AdvancedHMC.jl) because the algorithms may be more efficient than Differential Evolution MCMC. I tr…

---

## [Turing performance vs numpyro on horseshoe regression](https://discourse.julialang.org/t/turing-performance-vs-numpyro-on-horseshoe-regression/108626)

<div class="topic-metadata">

**Author:** [@jweinstk](https://discourse.julialang.org/u/jweinstk)\
**Replies:** 12\
**Last updated:** [January 28, 2024, 7:24pm UTC](https://discourse.julialang.org/t/turing-performance-vs-numpyro-on-horseshoe-regression/108626 "2024-01-28T19:24:16Z")

</div>

Hi all, I’ve benchmarked a simple implementation of regression with a horseshoe prior over the coefficients in both numpyro and Turing. I found numpyro to over an order of magnitude faster, which I found quite surprisin…

---

## [Variational Inference for Gaussian Mixture models](https://discourse.julialang.org/t/variational-inference-for-gaussian-mixture-models/109116)

<div class="topic-metadata">

**Author:** [@simonsteiger](https://discourse.julialang.org/u/simonsteiger)\
**Replies:** 4\
**Last updated:** [January 26, 2024, 10:58am UTC](https://discourse.julialang.org/t/variational-inference-for-gaussian-mixture-models/109116 "2024-01-26T10:58:15Z")

</div>

I’ve been trying to replicate the results from @rikh great blog post on Bayesian Latent Profile Analysis and the related post on this forum. This was my attempt using Turing x = randn(200); x\[1:100\] .+= 10 @model fun…

---

## [BetaBinomial: the condition α \> zero(α) is not satisfied](https://discourse.julialang.org/t/betabinomial-the-condition-zero-is-not-satisfied/109076)

<div class="topic-metadata">

**Author:** [@yahrMason](https://discourse.julialang.org/u/yahrMason)\
**Replies:** 6\
**Last updated:** [January 26, 2024, 2:02am UTC](https://discourse.julialang.org/t/betabinomial-the-condition-zero-is-not-satisfied/109076 "2024-01-26T02:02:33Z")

</div>

Hello, I have some code where I am trying to model the uncertainty in an a probabilistic prediction as a function of some independent variable. A general use case would be if I had an ML model in production (say logisti…

---

## [Include deterministic variables in the chain](https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 11:35pm UTC](https://discourse.julialang.org/t/include-deterministic-variables-in-the-chain/108047 "2024-01-25T23:35:23Z")

</div>

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

---

## [Issue with Float32 Precision in Turing Model Sampling](https://discourse.julialang.org/t/issue-with-float32-precision-in-turing-model-sampling/108160)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 11:33pm UTC](https://discourse.julialang.org/t/issue-with-float32-precision-in-turing-model-sampling/108160 "2024-01-25T23:33:36Z")

</div>

I’m encountering an issue when trying to use Float32 precision in a Turing.jl model. Despite ensuring all my data, neural network outputs, and model parameters are in Float32, I’m getting a type mismatch error during sam…

---

## [Bayesian Data Analysis Meetup on January 26, 2024 @ 6:30pm](https://discourse.julialang.org/t/bayesian-data-analysis-meetup-on-january-26-2024-6-30pm/108753)

<div class="topic-metadata">

**Author:** [@bparbhu](https://discourse.julialang.org/u/bparbhu)\
**Replies:** 2\
**Last updated:** [January 21, 2024, 11:11pm UTC](https://discourse.julialang.org/t/bayesian-data-analysis-meetup-on-january-26-2024-6-30pm/108753 "2024-01-21T23:11:09Z")

</div>

Hi All, So on Friday January 26th, I’ll be hosting the first Bayesian Data Analysis Meetup for 2024. Our speaker will be Brian Ward from the Flatiron Institute, who will be giving a talk on BridgeStan, the newest in-mem…

---

## [Differentiating random walk probability w.t.r. rate of jump](https://discourse.julialang.org/t/differentiating-random-walk-probability-w-t-r-rate-of-jump/107116)

<div class="topic-metadata">

**Author:** [@aner-sanchez](https://discourse.julialang.org/u/aner-sanchez)\
**Replies:** 16\
**Last updated:** [December 20, 2023, 3:11pm UTC](https://discourse.julialang.org/t/differentiating-random-walk-probability-w-t-r-rate-of-jump/107116 "2023-12-20T15:11:24Z")

</div>

Hello people! Perhaps this question should be in mathstackexchange, and sorry for the lousy formulation! but I feel this subject hits right in the heart of what I consider the Julia community. I’ve recently stumbled upon…

---

## [How to create sum-log-likelihood of custom distribution for use in Turing.jl](https://discourse.julialang.org/t/how-to-create-sum-log-likelihood-of-custom-distribution-for-use-in-turing-jl/107011)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 10\
**Last updated:** [December 8, 2023, 9:19am UTC](https://discourse.julialang.org/t/how-to-create-sum-log-likelihood-of-custom-distribution-for-use-in-turing-jl/107011 "2023-12-08T09:19:16Z")

</div>

I have a seemingly simple question about working with Turing.jl and Distributions.jl I’m hoping someone can help me with. For my work, I need to be able to define custom continuous, uni-variate distributions along with t…

---

## [Custom Models For Bayesian Inference](https://discourse.julialang.org/t/custom-models-for-bayesian-inference/107132)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 4\
**Last updated:** [December 5, 2023, 10:11pm UTC](https://discourse.julialang.org/t/custom-models-for-bayesian-inference/107132 "2023-12-05T22:11:56Z")

</div>

Hello all. I’m hoping someone can help me navigate the web of probabilistic programming packages so that I can begin using the Julia ecosystem for my custom models. I am experienced with Bayesian methods and probabilisti…

---

## [Comparison to numpyro](https://discourse.julialang.org/t/comparison-to-numpyro/106495)

<div class="topic-metadata">

**Author:** [@spragud2](https://discourse.julialang.org/u/spragud2)\
**Replies:** 9\
**Last updated:** [December 1, 2023, 7:42pm UTC](https://discourse.julialang.org/t/comparison-to-numpyro/106495 "2023-12-01T19:42:53Z")

</div>

Curious if anyone else has tried comparing Turing with Numpyro? I am working with a dataset of about N = 5,000 and fitting a bayesian MLP on top of a fine-tuned language model which I am viewing as a fixed feature extrac…

---

## [Running NUTS with a categorical prior?](https://discourse.julialang.org/t/running-nuts-with-a-categorical-prior/106871)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 8\
**Last updated:** [November 29, 2023, 11:16pm UTC](https://discourse.julialang.org/t/running-nuts-with-a-categorical-prior/106871 "2023-11-29T23:16:28Z")

</div>

Hello guys. I’m new to Turing.jl and I’m having some trouble building my model. It is supposed to be a relatively simple model. I have a forward operator called “MT” that takes 3 vectors as input (d,rho,f) and outputs “…

---

## [Turing Sampler remembering values from previous runs](https://discourse.julialang.org/t/turing-sampler-remembering-values-from-previous-runs/106715)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 0\
**Last updated:** [November 25, 2023, 6:58pm UTC](https://discourse.julialang.org/t/turing-sampler-remembering-values-from-previous-runs/106715 "2023-11-25T18:58:20Z")

</div>

Below I am trying to build a bayesian network model. As part of model checking, I was comparing the prior distribution to posterior distribution. For my model the posterior is same as prior, no change. But what’s weird i…

---

## [How to Determine Acceptance Rate in Turing.jl with Metropolis-Hastings Algorithm](https://discourse.julialang.org/t/how-to-determine-acceptance-rate-in-turing-jl-with-metropolis-hastings-algorithm/106689)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 0\
**Last updated:** [November 24, 2023, 5:31pm UTC](https://discourse.julialang.org/t/how-to-determine-acceptance-rate-in-turing-jl-with-metropolis-hastings-algorithm/106689 "2023-11-24T17:31:29Z")

</div>

I am working on a project with Turing.jl using the Metropolis-Hastings (MH) algorithm. I’m interested in tracking the acceptance rate of the sampler in real-time and obtaining the final acceptance rate after the inferenc…

---

## [Custom bijector in TuringLang Bijectors](https://discourse.julialang.org/t/custom-bijector-in-turinglang-bijectors/105278)

<div class="topic-metadata">

**Author:** [@hanyas](https://discourse.julialang.org/u/hanyas)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 6:36pm UTC](https://discourse.julialang.org/t/custom-bijector-in-turinglang-bijectors/105278 "2023-11-20T18:36:38Z")

</div>

I am new to Julia and I am trying to use the Bijectors.jl package to define a tanh bijector. Looking through the doc and the code, I came up with different versions of the following struct Tanh \<: Bijectors.Bijector end…

---

## [Introductive material on Bayesian Networks inference / probabilistic programming?](https://discourse.julialang.org/t/introductive-material-on-bayesian-networks-inference-probabilistic-programming/105017)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 12\
**Last updated:** [October 22, 2023, 6:01pm UTC](https://discourse.julialang.org/t/introductive-material-on-bayesian-networks-inference-probabilistic-programming/105017 "2023-10-22T18:01:27Z")

</div>

Hello, any (gentle) introductory material to suggest on the topic of Bayesian Networks and probabilistic programming ? Or knowledge I need in advance in order to understand it ? Context: I have clear the concepts of dis…

---

## [Matrix \* Vector randomvar in RxInfer model](https://discourse.julialang.org/t/matrix-vector-randomvar-in-rxinfer-model/104945)

<div class="topic-metadata">

**Author:** [@gvdr](https://discourse.julialang.org/u/gvdr)\
**Replies:** 0\
**Last updated:** [October 14, 2023, 3:24am UTC](https://discourse.julialang.org/t/matrix-vector-randomvar-in-rxinfer-model/104945 "2023-10-14T03:24:58Z")

</div>

Hello. I’m trying to extend one of the examples in RxInfer but hitting a wall. I’m working starting from the Gaussian Linear Dynamical System example. In particular I’m trying to generalise it so that we don’t assume t…

---

## [Compute (Bayesian) R2 for Turing models](https://discourse.julialang.org/t/compute-bayesian-r2-for-turing-models/104537)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 2\
**Last updated:** [October 3, 2023, 5:17pm UTC](https://discourse.julialang.org/t/compute-bayesian-r2-for-turing-models/104537 "2023-10-03T17:17:47Z")

</div>

Somehow my google search didn’t yield many results for how to compute R2 for Turing models. StatsBase.jl defines a few generic methods, but I was in particular interested in the so-called Bayesian R2 (Gelman et al., 201…

---

## [Slow MCMC sampling of complex polynomial model \[Turing.jl\]](https://discourse.julialang.org/t/slow-mcmc-sampling-of-complex-polynomial-model-turing-jl/102184)

<div class="topic-metadata">

**Author:** [@rubisco](https://discourse.julialang.org/u/rubisco)\
**Replies:** 2\
**Last updated:** [September 2, 2023, 10:25am UTC](https://discourse.julialang.org/t/slow-mcmc-sampling-of-complex-polynomial-model-turing-jl/102184 "2023-09-02T10:25:25Z")

</div>

In my model functions I use several complicated functions (long equations for Q and cd functions with many terms). Basically \[look in Q\_generated function\] they are some polynomials of v and w parameter - where v is scal…

---

## [Help with understanding Turing's predict function](https://discourse.julialang.org/t/help-with-understanding-turings-predict-function/102021)

<div class="topic-metadata">

**Author:** [@JanG](https://discourse.julialang.org/u/JanG)\
**Replies:** 3\
**Last updated:** [September 2, 2023, 9:42am UTC](https://discourse.julialang.org/t/help-with-understanding-turings-predict-function/102021 "2023-09-02T09:42:28Z")

</div>

Hi everybody, I played around a bit with the predict() function in Turing and encountered some behaviour I don’t quite understand. When I use it to produce new output based on a chain, it only seems to take some of the …

---

## [Within-chain parallelization with Turing.jl](https://discourse.julialang.org/t/within-chain-parallelization-with-turing-jl/103402)

<div class="topic-metadata">

**Author:** [@Nicolo\_Foppa](https://discourse.julialang.org/u/Nicolo_Foppa)\
**Replies:** 6\
**Last updated:** [September 1, 2023, 9:56pm UTC](https://discourse.julialang.org/t/within-chain-parallelization-with-turing-jl/103402 "2023-09-01T21:56:54Z")

</div>

Hi everyone, I’m a new Turing user and I read that there is a possible way to parallelize the MCMC of a single chain on multiple threads but I’m not able to do that. Do you have any references that I can use to have a b…

---

## [Error running Museinference.jl example](https://discourse.julialang.org/t/error-running-museinference-jl-example/103360)

<div class="topic-metadata">

**Author:** [@mgp](https://discourse.julialang.org/u/mgp)\
**Replies:** 7\
**Last updated:** [September 1, 2023, 6:58pm UTC](https://discourse.julialang.org/t/error-running-museinference-jl-example/103360 "2023-09-01T18:58:53Z")

</div>

Not sure if this should be a new topic. It follows on from https://discourse.julialang.org/t/ann-museinference-jl-drop-in-replacement-for-hmc-vi-try-it-on-your-problem/73468. When I run the example code @model function…

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

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