# Turing -- extract information of estimates/chains?

**URL:** <https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554>\
**Category:** General Usage\
**Tags:** dataframes, turing\
**Created:** [October 28, 2021, 2:17pm UTC](https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554 "2021-10-28T14:17:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [October 28, 2021, 2:17pm UTC](https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554/1 "2021-10-28T14:17:43Z")

</div>

I have run a Turing fitting session, and look at the results (estimates? chain?):

```julia
julia> p_est

```

leading to:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/0/90418e8bc7eab651b9467413f2fd4dec5f05bd7b.png)

Is it possible to extract the tables, e.g., Summary Statistics and Quantiles in _DataFrames_ so that I can PrettyTables them and convert them to LaTeX?

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [October 28, 2021, 3:09pm UTC](https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554/2 "2021-10-28T15:09:25Z")

</div>

`estDF = summarize(p_est)`

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [October 29, 2021, 11:13am UTC](https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554/3 "2021-10-29T11:13:08Z")

</div>

Neat. I found out that I can also use `describe(p_est)`, leading to two element vector where `summarize(p_est) = describe(p_est)[1]`, while element 2 contains the quantiles.

One more thing… (as they say):

- does `p_est` contain the prior distributions that were defined in the model, or would I need to take them out of the Turing `model`? [I’d like to compare the densities of the priors and the posteriors…]

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [October 29, 2021, 2:09pm UTC](https://discourse.julialang.org/t/turing-extract-information-of-estimates-chains/70554/4 "2021-10-29T14:09:13Z")

</div>

Assuming p\_est is a Chains object from a call to sample, it just contains posterior information. You can call sample in a way to get samples from the prior, have a look at the docs. Then you could compare say marginal densities using a KDE
