# How to extract priors from a Turing model

**URL:** https://discourse.julialang.org/t/how-to-extract-priors-from-a-turing-model/99568
**Category:** Statistics
**Tags:** turing, bayesian-inference
**Created:** [May 29, 2023, 2:29pm UTC](https://discourse.julialang.org/t/how-to-extract-priors-from-a-turing-model/99568 "2023-05-29T14:29:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DominiqueMakowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dominiquemakowski/32/51410_2.png) [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)
#### Post date: [May 29, 2023, 2:29pm UTC](https://discourse.julialang.org/t/how-to-extract-priors-from-a-turing-model/99568/1 "2023-05-29T14:29:26Z")

</div>

Assuming the following model:

```julia
# Bayesian linear regression.
@model function linear_regression(x, y)
    # Set variance prior.
    σ² ~ truncated(Normal(0, 100); lower=0)

    # Set intercept prior.
    intercept ~ Normal(0, sqrt(3))

    # Set the priors on our coefficients.
    nfeatures = size(x, 2)
    coefficients ~ MvNormal(Zeros(nfeatures), 10.0 * I)

    # Calculate all the mu terms.
    mu = intercept .+ x * coefficients
    return y ~ MvNormal(mu, σ² * I)
end

```

Is there a way to extract the priors set in the model? Something like:

```julia
(σ²=truncated(Normal(0, 100); lower=0), 
 intercept=Normal(0, sqrt(3)))

```

I couldn’t find any solutions in the Turing documentation, so thanks for any pointers!
