# Probabilistic Programming

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

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

**Page:** 12

---

## [Priors for generated quantities in Turing?](https://discourse.julialang.org/t/priors-for-generated-quantities-in-turing/57572)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 7\
**Last updated:** [April 18, 2021, 6:18am UTC](https://discourse.julialang.org/t/priors-for-generated-quantities-in-turing/57572 "2021-04-18T06:18:11Z")

</div>

I have a Turing model where I need (in part) to do something like this: @model test() = begin x = ones(10) sigma ~ InverseGamma(1, 1) x ~ Normal(0, sigma) end m1 = sample(test(), NUTS(0.65), 1000) I was a …

---

## [Understanding Stheno example](https://discourse.julialang.org/t/understanding-stheno-example/59450)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [April 16, 2021, 11:40pm UTC](https://discourse.julialang.org/t/understanding-stheno-example/59450 "2021-04-16T23:40:35Z")

</div>

This example fits a GP and plots something. I am trying to understand all the objects here. using Stheno using Stheno.AbstractGPs using CairoMakie # Short length-scale and small variance. const l1 = 0.4 const s1 = 0.2…

---

## [GPU and Thread-Parallel Support for Turing.jl](https://discourse.julialang.org/t/gpu-and-thread-parallel-support-for-turing-jl/58958)

<div class="topic-metadata">

**Author:** [@Koshroy](https://discourse.julialang.org/u/Koshroy)\
**Replies:** 1\
**Last updated:** [April 13, 2021, 10:03pm UTC](https://discourse.julialang.org/t/gpu-and-thread-parallel-support-for-turing-jl/58958 "2021-04-13T22:03:20Z")

</div>

Hey all, I’m a bit new to the Julia ecosystem and had a couple questions that some searching around didn’t answer: Is there a way to use the GPU to sample for Turing.jl models? And if there isn’t, is there a way to tr…

---

## [Stheno marginals](https://discourse.julialang.org/t/stheno-marginals/58943)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 7\
**Last updated:** [April 11, 2021, 12:48pm UTC](https://discourse.julialang.org/t/stheno-marginals/58943 "2021-04-11T12:48:30Z")

</div>

I’m trying to follow the examples but having some issues. What’s going wrong here? \[8188c328\] Stheno v0.7.1 # # This file just shows how some of the basic manipulations you can do in Stheno work in # practice. See the …

---

## [Stheno with Makie](https://discourse.julialang.org/t/stheno-with-makie/58882)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 4\
**Last updated:** [April 10, 2021, 1:04pm UTC](https://discourse.julialang.org/t/stheno-with-makie/58882 "2021-04-10T13:04:00Z")

</div>

How can I plot Stheno intervals with Makie (instead of Plots.jl)? Docs Stheno.jl knows how to use Plots.jl to plot GPs, so it’s straightforward to look at the posterior: x\_plot = range(-4.0, 4.0; length=1000); plot!…

---

## [Making a more type-stable arraydist for Turing?](https://discourse.julialang.org/t/making-a-more-type-stable-arraydist-for-turing/58871)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 3\
**Last updated:** [April 9, 2021, 1:00pm UTC](https://discourse.julialang.org/t/making-a-more-type-stable-arraydist-for-turing/58871 "2021-04-09T13:00:00Z")

</div>

I recently noticed that making an arraydist prior composed of different types of distributions leads to type instability (which seems a bit obvious, in hindsight). Playing around, I thought making a union of the componen…

---

## [Imputing Discrete Data](https://discourse.julialang.org/t/imputing-discrete-data/58662)

<div class="topic-metadata">

**Author:** [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Replies:** 14\
**Last updated:** [April 7, 2021, 12:02am UTC](https://discourse.julialang.org/t/imputing-discrete-data/58662 "2021-04-07T00:02:48Z")

</div>

I’m trying to use NUTS in Turing.jl to estimate some parameters, but have some missing data which follows a binomial distribution. Since I know NUTS can’t impute discrete variables so I’m trying to use Gibbs with PG to s…

---

## [Simplex transforms in Bijectors.jl (sorry)](https://discourse.julialang.org/t/simplex-transforms-in-bijectors-jl-sorry/56372)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 9\
**Last updated:** [April 4, 2021, 6:57pm UTC](https://discourse.julialang.org/t/simplex-transforms-in-bijectors-jl-sorry/56372 "2021-04-04T18:57:17Z")

</div>

I’d like to understand the ideas behind the way Bijectors handles simplices. First, something I think I understand, for comparison: TransformVariables julia\> using TransformVariables julia\> t = UnitSimplex(4) UnitSimp…

---

## [How to leverage conjugate priors](https://discourse.julialang.org/t/how-to-leverage-conjugate-priors/56636)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 2\
**Last updated:** [April 3, 2021, 9:51pm UTC](https://discourse.julialang.org/t/how-to-leverage-conjugate-priors/56636 "2021-04-03T21:51:46Z")

</div>

I have a Turing model that I’m using to estimate how evenly distributed some count variables of interest are. I’m using the concentration parameter of a symmetric Dirichlet distribution as a measure of evenness. A simpli…

---

## [Estimate correlation between two time series](https://discourse.julialang.org/t/estimate-correlation-between-two-time-series/58505)

<div class="topic-metadata">

**Author:** [@stebett](https://discourse.julialang.org/u/stebett)\
**Replies:** 0\
**Last updated:** [April 3, 2021, 2:29pm UTC](https://discourse.julialang.org/t/estimate-correlation-between-two-time-series/58505 "2021-04-03T14:29:31Z")

</div>

Hello, I’m a new Turing user and I’m not very familiar with probabilistic modeling, but the package is so cool that I couldn’t help trying to implement some of it :slight\_smile: Basically I have 2 Bernoulli/Poisson proc…

---

## [Stheno.jl@0.7](https://discourse.julialang.org/t/stheno-jl-0-7/58440)

<div class="topic-metadata">

**Author:** [@willtebbutt](https://discourse.julialang.org/u/willtebbutt)\
**Replies:** 0\
**Last updated:** [April 2, 2021, 11:53am UTC](https://discourse.julialang.org/t/stheno-jl-0-7/58440 "2021-04-02T11:53:21Z")

</div>

Stheno.jl v0.7 has now been released. It is a very breaking release, in that much of the main user-facing interface has been refactored to ensure compatibility with the AbstractGPs.jl ecosystem that the JuliaGaussianProc…

---

## [Factor mixture model in Turing - too slow?](https://discourse.julialang.org/t/factor-mixture-model-in-turing-too-slow/58394)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 1\
**Last updated:** [April 2, 2021, 12:32am UTC](https://discourse.julialang.org/t/factor-mixture-model-in-turing-too-slow/58394 "2021-04-02T00:32:51Z")

</div>

I have been trying to make a factor mixture model in Turing, but have run into some performance issues. To see where the slowdown comes from, I started by splitting the model into two separate models: a simple factor mo…

---

## [Alternative to Netica for Bayesian Modeling](https://discourse.julialang.org/t/alternative-to-netica-for-bayesian-modeling/58265)

<div class="topic-metadata">

**Author:** [@erlebach1](https://discourse.julialang.org/u/erlebach1)\
**Replies:** 1\
**Last updated:** [March 31, 2021, 3:04pm UTC](https://discourse.julialang.org/t/alternative-to-netica-for-bayesian-modeling/58265 "2021-03-31T15:04:47Z")

</div>

Hi, Does anybody know of a good package the duplicates or extends the functionality of Netica (commercial software) to model Bayesian networks? Would Forney.jl or Turing.jl be appropriate to this task? Thank you.

---

## [Burn-in in Metropolis-Hastings](https://discourse.julialang.org/t/burn-in-in-metropolis-hastings/57769)

<div class="topic-metadata">

**Author:** [@marouane1994](https://discourse.julialang.org/u/marouane1994)\
**Replies:** 9\
**Last updated:** [March 25, 2021, 6:38am UTC](https://discourse.julialang.org/t/burn-in-in-metropolis-hastings/57769 "2021-03-25T06:38:33Z")

</div>

i have written a metropolis-hastings code for myself but it doesn’t quite give me the smoothest result that i want so i want to put the burn-in in it, maybe finding a good starting point will increase the efficiency, the…

---

## [Poisson changepoint model: UK Coal Mining Disasters](https://discourse.julialang.org/t/poisson-changepoint-model-uk-coal-mining-disasters/57470)

<div class="topic-metadata">

**Author:** [@gsinha](https://discourse.julialang.org/u/gsinha)\
**Replies:** 10\
**Last updated:** [March 19, 2021, 8:32pm UTC](https://discourse.julialang.org/t/poisson-changepoint-model-uk-coal-mining-disasters/57470 "2021-03-19T20:32:36Z")

</div>

Hi: In an effort to learn Turing, I set out to replicate the UK Coal Mining disasters example. I think I’ve managed to successfully replicate the results - this is what I did. using Turing using Distributions using Dis…

---

## [QR Parameterization in Turing](https://discourse.julialang.org/t/qr-parameterization-in-turing/57203)

<div class="topic-metadata">

**Author:** [@Storopoli](https://discourse.julialang.org/u/Storopoli)\
**Replies:** 2\
**Last updated:** [March 16, 2021, 8:19am UTC](https://discourse.julialang.org/t/qr-parameterization-in-turing/57203 "2021-03-16T08:19:41Z")

</div>

A question to Turing Specialists. I performed a QR decomposition on my model matrix X. #### QR Decomposition #### Q, R = qr(X) Then i fitted a Turing Model to my Q Matrix, casting it to a Matrix: model\_qr = varying\_i…

---

## [DataLoader-like interface for Turing?](https://discourse.julialang.org/t/dataloader-like-interface-for-turing/56678)

<div class="topic-metadata">

**Author:** [@qft](https://discourse.julialang.org/u/qft)\
**Replies:** 6\
**Last updated:** [March 7, 2021, 5:53pm UTC](https://discourse.julialang.org/t/dataloader-like-interface-for-turing/56678 "2021-03-07T17:53:55Z")

</div>

I am very recently introduced to Turing. In all the example code I see, the model is given a fixed set of observation, and sample a for specific number of iterations. I am wondering, is it possible to use a different sub…

---

## [SampleChains](https://discourse.julialang.org/t/samplechains/55937)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 27\
**Last updated:** [March 4, 2021, 4:28pm UTC](https://discourse.julialang.org/t/samplechains/55937 "2021-03-04T16:28:51Z")

</div>

I’m working on a new interface for chains from MCMC sampling: I’ve copied the README below. I’d love any feedback on the interface, or ideas for making it more useful and/or powerful. Gratuitous @-ing… @Tamas\_Papp t…

---

## [ForwardDiff.dual TypeError while Solving ODE with 3 by 3 Matrix Input and ProximalOperators Package which Keep the Output Positive Definite](https://discourse.julialang.org/t/forwarddiff-dual-typeerror-while-solving-ode-with-3-by-3-matrix-input-and-proximaloperators-package-which-keep-the-output-positive-definite/56039)

<div class="topic-metadata">

**Author:** [@yushang-lai](https://discourse.julialang.org/u/yushang-lai)\
**Replies:** 1\
**Last updated:** [March 3, 2021, 5:01pm UTC](https://discourse.julialang.org/t/forwarddiff-dual-typeerror-while-solving-ode-with-3-by-3-matrix-input-and-proximaloperators-package-which-keep-the-output-positive-definite/56039 "2021-03-03T17:01:39Z")

</div>

Hi! I write a Turing ODE code as follows: The data is u\_account = \[953.0; 1075.0; 1223.0\] which represents three states \[A,B,C\] being observed. The parameter p consists of variables \[v1,v2,v4,u1,u3,w1\] Vector u\_mean d…

---

## [Link function Bijectors.jl](https://discourse.julialang.org/t/link-function-bijectors-jl/56362)

<div class="topic-metadata">

**Author:** [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Replies:** 3\
**Last updated:** [March 3, 2021, 12:10am UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362 "2021-03-03T00:10:17Z")

</div>

Dear All, I would like to ask probably a stupid question. What exactly does link() function? Documentation: link: maps a sample of a random distribution dist from its support to a value in R^n. Example: \` How how exac…

---

## [Turing fails to precompile](https://discourse.julialang.org/t/turing-fails-to-precompile/56011)

<div class="topic-metadata">

**Author:** [@marouane1994](https://discourse.julialang.org/u/marouane1994)\
**Replies:** 4\
**Last updated:** [February 25, 2021, 6:24pm UTC](https://discourse.julialang.org/t/turing-fails-to-precompile/56011 "2021-02-25T18:24:07Z")

</div>

I just installed Julia 1.5 and i started to add the packages and i added Turing.jl but when i type: julia\> using Turing i get this message: \[ Info: Precompiling Turing \[fce5fe82-541a-59a6-adf8-730c64b5f9a0\] ERROR: Loa…

---

## [\[video\] A beginners guide to Bayesian Cognitive Modelling](https://discourse.julialang.org/t/video-a-beginners-guide-to-bayesian-cognitive-modelling/56025)

<div class="topic-metadata">

**Author:** [@drbenvincent](https://discourse.julialang.org/u/drbenvincent)\
**Replies:** 4\
**Last updated:** [February 25, 2021, 5:52pm UTC](https://discourse.julialang.org/t/video-a-beginners-guide-to-bayesian-cognitive-modelling/56025 "2021-02-25T17:52:49Z")

</div>

Just in case people here are interested, here is a video of a seminar talk I was invited to give to the Psychology department at the University of Leicester, UK. I go through some examples using Julia and Turing. As well…

---

## ["Learning Bayesian Statistics" podcast episode](https://discourse.julialang.org/t/learning-bayesian-statistics-podcast-episode/37229)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 4\
**Last updated:** [February 25, 2021, 12:54am UTC](https://discourse.julialang.org/t/learning-bayesian-statistics-podcast-episode/37229 "2021-02-25T00:54:05Z")

</div>

I was invited as a guest on this podcast, got to talk a lot about Julia. Episode is #13 Building a Probabilistic Programming Framework in Julia, with Chad Scherrer We talk about Soss, the design and ecosystem of Julia…

---

## [How to plot credible intervals for MCMCChains?](https://discourse.julialang.org/t/how-to-plot-credible-intervals-for-mcmcchains/55639)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [February 23, 2021, 11:58pm UTC](https://discourse.julialang.org/t/how-to-plot-credible-intervals-for-mcmcchains/55639 "2021-02-23T23:58:25Z")

</div>

Is there a way to get plots of intervals given mysample::MCMCChains.Chains? I’m looking for something like the following from stan:

---

## [Mixture models with binary indicator variables](https://discourse.julialang.org/t/mixture-models-with-binary-indicator-variables/55219)

<div class="topic-metadata">

**Author:** [@drbenvincent](https://discourse.julialang.org/u/drbenvincent)\
**Replies:** 11\
**Last updated:** [February 18, 2021, 12:43pm UTC](https://discourse.julialang.org/t/mixture-models-with-binary-indicator-variables/55219 "2021-02-18T12:43:08Z")

</div>

I’m having trouble with a number of models which all involve a mixture model with binary indicator variables. I’m reasonably sure they are all suffering from the same underlying issue, and I’m semi-convinced the problem …

---

## [Logistic Regression Mixture Model](https://discourse.julialang.org/t/logistic-regression-mixture-model/55406)

<div class="topic-metadata">

**Author:** [@Carter](https://discourse.julialang.org/u/Carter)\
**Replies:** 2\
**Last updated:** [February 17, 2021, 2:20pm UTC](https://discourse.julialang.org/t/logistic-regression-mixture-model/55406 "2021-02-17T14:20:23Z")

</div>

I’m trying to implement robust logistic regression fromchapter 10.5 of PML. The model is p(y|\\mathbf{x}) = \\pi Ber(y|0.5) + (1-\\pi) Ber(y|\\sigma(\\mathbf{w}^\\top\\mathbf{x})) where \\pi are the mixture weights drawn from a …

---

## [Strange issues fitting GMMs in Turing.jl by extending a fairly simple example](https://discourse.julialang.org/t/strange-issues-fitting-gmms-in-turing-jl-by-extending-a-fairly-simple-example/55232)

<div class="topic-metadata">

**Author:** [@HarrisonWilde](https://discourse.julialang.org/u/HarrisonWilde)\
**Replies:** 10\
**Last updated:** [February 15, 2021, 9:54am UTC](https://discourse.julialang.org/t/strange-issues-fitting-gmms-in-turing-jl-by-extending-a-fairly-simple-example/55232 "2021-02-15T09:54:29Z")

</div>

I have been extending the Turing example on Bayesian GMMs today in a number of ways, trying it out with non-symmetric 2D Gaussian locations and more clusters than the two in the example I have linked, and namely with som…

---

## [Turing: help with slow model](https://discourse.julialang.org/t/turing-help-with-slow-model/54563)

<div class="topic-metadata">

**Author:** [@drbenvincent](https://discourse.julialang.org/u/drbenvincent)\
**Replies:** 46\
**Last updated:** [February 13, 2021, 11:19am UTC](https://discourse.julialang.org/t/turing-help-with-slow-model/54563 "2021-02-13T11:19:03Z")

</div>

So I’m making progress with implementing a bunch of models in Turing. But one I’ve had problems with is this. using Turing, StatsPlots sᵇ = \[15,11,15,14,15,18,16,16,18,16,15,13,18,12,11,13,17,18,16,11,17,18,12,18,18,14…

---

## [\[Turing.jl\] Censored Values](https://discourse.julialang.org/t/turing-jl-censored-values/48990)

<div class="topic-metadata">

**Author:** [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Replies:** 21\
**Last updated:** [February 13, 2021, 11:14am UTC](https://discourse.julialang.org/t/turing-jl-censored-values/48990 "2021-02-13T11:14:28Z")

</div>

Hi there Turing.jl peoples. Still new as ever to Bayes stuff, but having a blast learning(when I can). I ran into a situation where I want to explore censored modelling. I’ve scoured the documentation in Turing.jl and d…

---

## [Best Practice for Logging MCMC Results?](https://discourse.julialang.org/t/best-practice-for-logging-mcmc-results/54832)

<div class="topic-metadata">

**Author:** [@JonB27](https://discourse.julialang.org/u/JonB27)\
**Replies:** 4\
**Last updated:** [February 12, 2021, 3:37pm UTC](https://discourse.julialang.org/t/best-practice-for-logging-mcmc-results/54832 "2021-02-12T15:37:45Z")

</div>

I will be deploying a custom MCMC algorithm to an external computer as part of my thesis. I’m making heavy use of the Gen PPL, and was wondering how best to return the results of the MCMC. My idea so far was to write eac…

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

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