This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
Neal's funnel | |
https://mc-stan.org/docs/2_29/stan-users-guide/reparameterization.html#ref-papa-et-al:2007 | |
=# | |
using Turing, StatsPlots, Distributions, DataFrames | |
gr() # set backend | |
@model function Neal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing, HiddenMarkovModels | |
using PosteriorDB | |
using Makie, CairoMakie | |
using LinearAlgebra, LogExpFunctions | |
using DataFrames | |
# Get the dataset and validated reference draws from PosteriorDB | |
pdb = PosteriorDB.database() # Data import | |
data = PosteriorDB.load(PosteriorDB.dataset(pdb, "hmm_example")) | |
ref_post = DataFrame(PosteriorDB.load(PosteriorDB.reference_posterior(pdb, "hmm_example-hmm_example"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[deps] | |
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" | |
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" | |
HiddenMarkovModels = "84ca31d5-effc-45e0-bfda-5a68cd981f47" | |
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | |
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" | |
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" |