-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathppl_hbm.jl
More file actions
2317 lines (1913 loc) · 82.9 KB
/
ppl_hbm.jl
File metadata and controls
2317 lines (1913 loc) · 82.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### A Pluto.jl notebook ###
# v0.19.6
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
end
# ╔═╡ ab655734-a8b7-47db-9b73-4099c4b11dfc
begin
using CSV, DataFrames
#using LinearAlgebra, PDMats
using Optim, ForwardDiff, Tracker #ReverseDiff#Zygote
using Turing, DynamicPPL, Distributions
using MCMCChains
using FillArrays
using Plots, StatsPlots, LaTeXStrings#, PairPlots, , ColorSchemes
using PlutoUI, HypertextLiteral
# Set a seed for reproduciblity.
using Random
Random.seed!(0)
#using StableRNGs;
#rng = StableRNG(42);
Turing.setadbackend(:tracker)
if false
# Hide the progress prompt while sampling.
#Turing.setprogress!(false);
import Logging
Logging.disable_logging(Logging.Warn)
end
end;
# ╔═╡ 1c651c38-d151-11ec-22a6-87180bd6546a
md"""
# Lab 13: Hierarchical Bayesian Modeling with a PPL
#### [Penn State Astroinformatics Summer School 2022](https://sites.psu.edu/astrostatistics/astroinfo-su22-program/)
#### [Eric Ford](https://www.personal.psu.edu/ebf11)
"""
# ╔═╡ c217818e-03c6-4303-b723-3f4e7263dccb
md"""
## Overview
In this lab, we'll analyze the eccentricity distribution of a population of planets using a hierarchical Bayesian Model and the [Turing](https://turing.ml/) probabilistic programming language (PPL).
You'll be able to generate synthetic data sets from multiple intrinsic distributions, choose the magnitude of measurement uncertainties, and compare the true intrinsic distribution to the inferred distribution.
The purpose of the lab is to demonstrate how you can implement a hierarchical Bayesian analysis quickly with a probabilistic programming language without having to compute a bunch of conditional probability distributions yourself (either because your model doesn't lend itself to analytic expressions or you just don't want to spend your time doing that).
Similar to the other lab for hierarchical Bayesian modeling, you'll be able to inspect how the posterior distributions for individual objects shrink in a hierarchical model. If you have extra time, then you'll also be able to explore what happens when you analyze your population using a model that differs from the true model.
"""
# ╔═╡ 63a4e3e4-1645-4715-90b1-b708379706ef
md"""
## Set Properties of the Synthetic Data set
First, you'll select a model to use for generating a synthetic population of planets.
Second, you'll set the prior values needed by that model.
Then, you'll set the number of planets to include in our synthetic data set and the magnitude of measurement uncertainties.
"""
# ╔═╡ 2487706a-f408-4cc4-901a-f2b72fe562d4
md"""
## Generate dataset
The distribution you selected is stored in `dist_gen` and a sampler for that model is stored in `sampling_alg`.
There's some helper code at the bottom of the notebook that collects the inputs above into the variable `param_true`. The code below conditions the generative model you selected on the true population parameters and draws a realization of the data conditioned on the true population parameters. That draw provides both the "true" eccentricities and the "observed eccentricities" that you'll analyze later.
"""
# ╔═╡ 90ae54f1-c49d-4d66-82eb-eb783c389e54
md"""
### Plot the data
It's often good to make a quick plot to help understand the characteristics of the data.
Number of draws: $(@bind num_draws NumberField(100:100:10000, default=400))
Number of bins for histogram: $(@bind num_bins NumberField(10:10:200, default=40))
"""
# ╔═╡ def5056e-4817-4602-bd70-97f5798a92f1
md"""
**Question:** For what values of the measurement uncertainty is there a significant difference between the observed distribution and the intrinsic distribution?
**Question:** How would your response above change if you increase the number of planets by a factor of 2? 10?
**Question:** Try changing the parameters of the intrinsic distribution to result in a more/less narrowly peaked intrinsic eccentricity distribution. How does that affect the number of planets required before the observed and intrinsic distributions are significantly different?
"""
# ╔═╡ 58b4382b-6a5e-43c0-8f93-7f5602efc230
md"## Analyze with a HBM"
# ╔═╡ df58fcff-bc39-44b5-866d-979b29f23c28
md"""
The model you selected for analyze the data with above is stored in the variable `param_mcmc.dist_infer`. The next cell conditions that model on the data generated previously.
"""
# ╔═╡ a6a18eea-cca6-4cdd-bfab-a88169d0f84d
md"### Run MCMC"
# ╔═╡ 41308bbf-d857-427d-b83b-0b0527b86ce0
md"""Once you've checked the "Ready to run MCMC" box above and clicked submit, it will running a Markov chain. This can take anywhere from several seconds to minutes or hours, depending on the choice of model, number of observations and length of the Markov chain. Therefore, it's suggested that you start with a short Markov chain. For the purposes of this lab, you may be able to work with short Markov chains, even if there's signs that they haven't fully converged."""
# ╔═╡ 6fae3f66-9e37-4617-aac0-6d3625f338c7
md"### Results for the population parameters"
# ╔═╡ e881c5af-b1da-45e6-8e43-fd81ac8f0daf
md"The sampler returns the results of one (or more) MCMC chains that can be used for inference. For example, we can get some summary statistics about the model parameters and their convergence diagnostics. "
# ╔═╡ 3fb2aca3-e903-4488-b67f-15ff9b040b67
md"### Results for inferred population"
# ╔═╡ f6618ef6-10e0-4d5f-ad8c-16c86c3854c0
md"Compute inferred distribution $(@bind inferred_ready CheckBox() )"
# ╔═╡ b3ff4257-4758-4fc9-9a74-5150c41866f1
md"""
## Questions to Guide your Exploration
Once you've thought through the results for a first calculation, it's time to do some numerical experiment.
### Effects of sample size and measurement uncertainty
First, choose the same model to generate a sample and to perform inference.
**Question:** Is the inferred distribution a good approximation to the intrinsic distribution? Is it significantly better than treating the observed distribution as an approximation to the intrinsic distribution?
**Question:** How does the above change if you increase the number of planets by a factor of 2?
**Question:** Try increasing the measurement uncertainty to 0.2. Can you still recover the intrinsic distribution accurately by increasing the number of planets?
"""
# ╔═╡ 667a3efc-1746-4997-8b85-04e96a0183cf
md"""
### Posterior for each Planet's Eccentricity
We can also look at the posterior distribution for each planet's eccentricity (blue) and compare it to the measurement for that planet (red) and the true value (green). Make sure to use the slider to inspect several planets.
"""
# ╔═╡ d322b5de-62dd-4c6e-af05-3452af511c62
md"""
**Question:** How does the width of the posterior compare to the width of the measurement? How do you expect that would change if you vary the measurement precision or the number of of planets in your sample?
**Question:** Do you recognize a trend for location of the mode of the posterior relative to the mode of the measurement distribution? Why is that? How would the difference change in you chose an intrinsic distribution that was less sharply peaked?
"""
# ╔═╡ 1b85cf6a-6300-4dd2-a764-670570bde946
md"""
### Effects of model misspecification (optional)
If you still have time, consider choosing one model to generate the data and a different model to perform inference with.
**Question:** How does the distribution inferred with the wrong model compare to the distribution inferred with the correct model?
**Question:** Under what circumstances are some quantitative or qualitative properties robustly inferred, even when using the wrong model? Why factor contribute to that?
"""
# ╔═╡ a480bd7a-a4a9-43c7-81f5-77d15ec16289
md"""
# Setup & Helper Code
"""
# ╔═╡ cf44e114-4ac5-4bf1-9b5a-ef6b4f5e6bc9
md"## Code for Turing Models Used"
# ╔═╡ 8c5b0d18-70bd-4fd4-9f94-99c67b3f8bc0
md"### Beta Distribution"
# ╔═╡ 6cb2fbfb-646e-4e5c-ae5c-c3146f19d76c
begin
@model function eccentricities_beta(e_obs, σₑ, ::Type{T} = Float64) where {T}
@assert size(σₑ) == size(e_obs)
N = size(e_obs,1)
@assert N >= 1
# Prior for hyperparameter(s)
α ~ truncated(Exponential(),lower=0.5)
β ~ truncated(Exponential(),lower=0.5)
dist_e = Beta(α,β)
e_latent = Vector{T}(undef, N)
# Specify liklihood
for i ∈ eachindex(e_obs)
e_latent[i] ~ dist_e # Latent variables
e_obs[i] ~ truncated(Normal(e_latent[i], σₑ[i]),0,1) # Observed variables
end
return (;e_latent, e_obs)
end
# Convenience functions
eccentricities_beta(df::DataFrame) = eccentricities_beta(df.e_obs, df.σₑ)
eccentricities_beta(n::Integer, σ = 0.0) = eccentricities_beta( missings(n), fill(σ,n) )
# Sampler to use for this model
sampler_beta = NUTS(0.65)
end
# ╔═╡ 0cef66f6-44c4-4f3e-b901-ac8d33bad4a7
md"### Rayleigh Distribution"
# ╔═╡ b8ab2460-7c59-4e87-8580-e7b49f0576aa
begin
@model function eccentricities_rayleigh(e_obs, σₑ, ::Type{T} = Float64) where {T}
@assert size(σₑ) == size(e_obs)
N = size(e_obs,1)
@assert N >= 1
# Prior for hyperparameter(s)
σᵣ ~ Uniform(1e-4, 0.5)
e_latent = Vector{T}(undef, N)
# Specify liklihood
for i ∈ eachindex(e_obs)
e_latent[i] ~ truncated(Rayleigh(σᵣ), lower=1e-4, upper=1) # Latent variables
e_obs[i] ~ truncated(Normal(e_latent[i], σₑ[i]),0,1) # Observed variables
end
return (;e_latent, e_obs)
end
# Convenience functions
eccentricities_rayleigh(df::DataFrame) = eccentricities_rayleigh(df.e_obs, df.σₑ)
eccentricities_rayleigh(n::Integer, σ = 0.0) = eccentricities_rayleigh( missings(n), fill(σ,n) )
# Sampler to use for this model
sampler_rayleigh = NUTS(0.65)
end
# ╔═╡ 0b987316-b554-4497-9731-765dfe3a514d
md"## Appearances"
# ╔═╡ d78db46d-1e20-4cd1-be53-81f635561b27
TableOfContents()
# ╔═╡ deb1a219-f33c-469c-98a9-5bab181e4a43
function aside(x)
@htl("""
<style>
@media (min-width: calc(700px + 30px + 300px)) {
aside.plutoui-aside-wrapper {
position: absolute;
right: -11px;
width: 0px;
}
aside.plutoui-aside-wrapper > div {
width: 300px;
}
}
</style>
<aside class="plutoui-aside-wrapper">
<div>
$(x)
</div>
</aside>
""")
end
# ╔═╡ e5fd7d7b-92dc-4232-8295-f81e39385ca3
aside(md"""
!!! tip "Tip: Choices here affect calculation time below"
Both the number of planets in our sample (set here) and the length of the Markov chains (set later) that you choose will affect the run-time (roughly proportional to the product for a given mode).
It's suggested that you start with a small data set, so you get more prompt feedback (even if the Markov chains still show some signs that they haven't fully converged and you wouldn't use them in a science paper). Near the end of the lab, you may want to try analyzing a larger data set and/or running a longer MCMC calculations (e.g., while you take a coffee break).
""")
# ╔═╡ c8ea0fb7-f8e6-4cdf-b81b-b1eb9d3a5f7d
nbsp = html" "
# ╔═╡ cede1027-5425-448a-9c86-70d27a0942de
br = html"<br />"
# ╔═╡ 57bd6ed3-1382-40e7-8422-8ec9cb50e23f
begin
max_num_planets = 500
default_num_planets = 50
default_σₑ = 0.1
end;
# ╔═╡ c62ef364-ae3a-4b41-b808-567fef6f895e
function pick_param_uniform()
@bind param_uniform confirm(
PlutoUI.combine() do Child
md"""
min e: $(Child("min_e",NumberField(0.0:0.001:0.2,default=0.0)))
max e: $(Child("max_e",NumberField(0.01:0.01:1,default=0.5)))
Number of Planets: $(Child("num_pl",NumberField(1:max_num_planets,default=default_num_planets)))
Measurement uncertainty: $(Child("σₑ",NumberField(0:0.01:1,default=default_σₑ)))
"""
end
)
end
# ╔═╡ 230ad18a-c830-4e86-9edb-83e541994006
function pick_param_beta()
# Default values from Kipping 2013
@bind param_beta confirm(
PlutoUI.combine() do Child
md"""
α: $(Child("α",NumberField(0.5:0.01:10,default=0.867)))
β: $(Child("β",NumberField(0.5:0.01:10,default=3.03)))
Number of Planets: $(Child("num_pl",NumberField(1:max_num_planets,default=default_num_planets)))
Measurement uncertainty: $(Child("σₑ",NumberField(0:0.01:1,default=default_σₑ)))
"""
end
)
end
# ╔═╡ 981a9b4d-d4cd-4497-99c9-f0747e042f0b
function pick_param_rayleigh()
@bind param_rayleigh confirm(
PlutoUI.combine() do Child
md"""
σᵣ: $(Child("σᵣ",NumberField(0.005:0.005:1,default=0.01)))
Number of Planets: $(Child("num_pl",NumberField(1:max_num_planets,default=default_num_planets)))
Measurement uncertainty: $(Child("σₑ",NumberField(0:0.01:1,default=default_σₑ)))
"""
end
)
end
# ╔═╡ ef766433-4510-424c-b63a-ab9a81a7461e
begin # Set choices for distributions
model_list = [
eccentricities_rayleigh,
eccentricities_beta,
]
model_name_list = [
"Rayleigh",
"Beta",
]
model_choices = model_list .=> model_name_list
end;
# ╔═╡ b6ecfca2-05c9-4f6b-b09a-6118557ba616
md"Generative Model: $(@bind dist_gen Select(model_choices))"
#=
@bind param_gen confirm(
PlutoUI.combine() do Child
md"""
Generative Model: $(Child("dist_gen",Select(model_choices)))
"""
end
)
=#
# ╔═╡ 32193e43-cbd6-4414-9044-f8bc58d13d90
if dist_gen == eccentricities_rayleigh
sampling_alg = sampler_rayleigh
pick_param_rayleigh()
elseif dist_gen == eccentricities_rayleigh_mixture
sampling_alg = sampler_rayleigh_mixture
pick_param_rayleigh_mixture()
elseif dist_gen == eccentricities_beta
sampling_alg = sampler_beta
pick_param_beta()
elseif dist_gen == eccentricities_uniform
sampling_alg = sampler_uniform
pick_param_uniform()
else
md"""
!!! error "Notebook doesn't have code to set generative model parameters."
"""
end
# ╔═╡ b0c94cb0-f992-4ebf-86f0-66d3ebc4aa9e
@bind param_mcmc confirm(
PlutoUI.combine() do Child
md"""
Inferential Model: $(Child("dist_infer",Select(model_choices)))
Length of Markov chains: $(Child("num_iterations",NumberField(100:100:5000,default=100)))
Ready to run MCMC? $(Child("ready",CheckBox()))
"""
end
)
#Try to initialize from MAP? $(Child("init_map",CheckBox(default=false)))
# ╔═╡ 921a7aa8-f96a-4593-962b-d97be4d7014c
if dist_gen == eccentricities_rayleigh
num_pl = param_rayleigh.num_pl
param_true = param_rayleigh
elseif dist_gen == eccentricities_beta
num_pl = param_beta.num_pl
param_true = param_beta
else
num_pl = nothing
param_true = nothing
md"""
!!! error "Notebook doesn't have code to set generative model parameters."
"""
end
# ╔═╡ 106f5b0a-ab06-450f-b541-56ca64d7347f
begin # Generate synthetic dataset
# Create model conditioned on _missing_ values for e_obs, but numerical values for σₑ
model_use = dist_gen(num_pl, param_true.σₑ)
# Create model that also conditions on the true population parameter values
model_true = condition(model_use, param_true )
# Draw data conditioned on true population parameters
data = model_true()
# Cosmetic details
data = DataFrame(data, copycols=false) # Repackage data into DataFrame
rename!(data,:e_latent=>:e_true) # Rename column
data.σₑ .= param_true.σₑ # Add measurement uncertainties
data
end;
# ╔═╡ ffae4c63-78db-4ce0-bf25-ab53845db6e8
begin
samples_true = mapreduce(i->DataFrame(model_true()),append!, 1:num_draws, init=DataFrame())
end;
# ╔═╡ efcabcc4-40ed-4492-b3e4-e190be248fce
let
max_e_plt = max(maximum(samples_true.e_obs),maximum(samples_true.e_latent))
bins_plt = range(0,stop=max_e_plt,length=num_bins)
plt1 = plot()
histogram!(plt1,data.e_true, bins=bins_plt, alpha=0.8, label="Actual e's")
histogram!(plt1,data.e_obs, bins=bins_plt, alpha=0.8, label="Observed e's")
ylabel!(plt1,"Count")
plt2 = plot()
histogram!(plt2,samples_true.e_latent,
weights=repeat([num_bins/(max_e_plt*length(samples_true.e_latent))],length(samples_true.e_latent)),
bins=bins_plt, alpha=0.25, label="Intrinsic Distribution")
histogram!(plt2,samples_true.e_obs,
weights=repeat([num_bins/(max_e_plt*length(samples_true.e_latent))],length(samples_true.e_latent)),
bins=bins_plt, alpha=0.25, label="Observed Distribution")
ylabel!(plt2,"PDF")
xlabel!(plt2, "Eccentricity")
l = @layout [a;b]
plot(plt1,plt2, layout=l)
end
# ╔═╡ 2240141a-5c05-4b4c-8c74-0aea660d76fd
(; mean_e_obs = mean(data.e_obs), mean_e_true = mean(data.e_true) )
# ╔═╡ 97c7a26f-635b-416f-a475-fb3cef270b26
if false # Density plots
plt = plot()
density!(data.e_true, label="KDE of actual e's")
density!(data.e_obs, label="KDE of observed e's")
xlabel!("Eccentricity")
ylabel!("PDF")
end
# ╔═╡ 614bf8fe-f34e-403e-9399-85045d787ac3
model = param_mcmc.dist_infer(data)
# ╔═╡ 6a23b1e6-fd0f-406d-bc93-c713cecc8fe3
if inferred_ready
md"Observation number to plot: $(@bind plt_pl_id Slider(1:num_pl))"
end
# ╔═╡ d614f82e-a233-4896-8b9b-26a357f28ff0
if param_mcmc.dist_infer == eccentricities_rayleigh
param_init = (;σᵣ = 0.3)
elseif param_mcmc.dist_infer == eccentricities_beta
param_init = (; α = 1, β = 1)
else
param_init = nothing
md"""
!!! error "Notebook doesn't have code to set generative model parameters."
"""
end
# ╔═╡ 5e002142-7391-4536-aa95-2a422daff27c
begin
opt_start_param = merge( param_init,
NamedTuple([Symbol("e_latent[$i]") for i in 1:num_pl] .=> data.e_obs ) )
param_start_mcmc = opt_start_param
end;
# ╔═╡ 1123ba8b-e638-4a6e-96d3-c51d085b4dc7
param_start_mcmc
# ╔═╡ 741dfd1a-8d46-4458-9f9c-ecd1f62d8da2
if param_mcmc.ready # Only run MCMC if Ready box is checked above
# Run MCMC starting from MAP
if length(param_start_mcmc) > 0
chain = sample(model, sampling_alg, param_mcmc.num_iterations, init_params=param_start_mcmc)
else
chain = sample(model, sampling_alg, param_mcmc.num_iterations)
end
end;
# ╔═╡ c61b6695-8d7a-4b1c-97b0-c8df28cc6723
if param_mcmc.ready && inferred_ready
#sample_from_chain = sample(chain,2*num_draws)
sample_from_chain = sample(chain,min(max(num_draws,100),param_mcmc.num_iterations))
chain_post_pred = predict(model, sample_from_chain, include_all=true)
end;
# ╔═╡ b6515c1c-8e0c-4084-8be3-8021f5d497bc
if param_mcmc.ready && inferred_ready
max_e_plt = max(maximum(data.e_obs), maximum(samples_true.e_latent))
bins_plt = range(0,stop=max_e_plt,length=num_bins)
samples_post_pred_latent = vec(Array(group(chain_post_pred,"e_latent")))
plt1 = histogram(samples_true.e_latent,
weights=repeat([num_bins/(max_e_plt*length(samples_true.e_latent))],length(samples_true.e_latent)),
bins=bins_plt, alpha=0.5, label="Intrinsic Distribution")
histogram!(vec(Array(group(chain_post_pred,"e_latent"))),
weights=repeat([num_bins/(max_e_plt*length(samples_post_pred_latent))],length(samples_post_pred_latent)),
bins=bins_plt, alpha=0.5, label="Inferred Distribution")
ylabel!("PDF")
plt2 = histogram(data.e_obs,
weights=repeat([num_bins/(max_e_plt*length(data.e_obs))],length(data.e_obs)),
bins=bins_plt, alpha=0.75, label="Observed e's")
histogram!(plt2,samples_true.e_obs,
weights=repeat([num_bins/(max_e_plt*length(samples_true.e_latent))],length(samples_true.e_latent)),
bins=bins_plt, alpha=0.25, label="Observed e's distribution")
ylabel!("PDF")
xlabel!("Eccentricity")
l = @layout [a;b]
plot(plt1,plt2,layout=l)
#histogram!(samples_true.e_obs,nbins=range(0,stop=1,length=num_bins), alpha=0.5, label="Observed Distribution")
end
# ╔═╡ 039fd2fb-ab74-4d11-8144-e4264def99cf
if param_mcmc.ready && inferred_ready
plot(xlabel=latexstring("e_{" * string(plt_pl_id) * "}"),
ylabel = "Posterior PDF", xlims=(0,min(1,max(data.e_obs[plt_pl_id]+2.5*data.σₑ[plt_pl_id],maximum(chain_post_pred["e_latent[$plt_pl_id]"])))) )
density!(chain_post_pred["e_latent[$plt_pl_id]"],
label="Posterior", nbins=40)
plot!(Normal(data.e_obs[plt_pl_id], data.σₑ[plt_pl_id]), label="Measurement")
plot!(fill(data.e_true[plt_pl_id],2),[0,1], label=:none)
end
# ╔═╡ 6d4a9e19-9511-45ff-b74a-a37f0caaa16a
begin
pop_params = param_true[setdiff(keys(param_true), [:num_pl, :σₑ])]
pop_param_names = collect(keys(pop_params))
infer_pop_param_names = collect(keys(param_init))
end;
# ╔═╡ 9e24813e-96a1-4fe5-81e7-def708d150c9
if param_mcmc.ready
chain_pop_param = chain[infer_pop_param_names]
summarize(chain_pop_param)
end
# ╔═╡ d452c7f4-2f04-4972-ada9-cd4e71cd787f
if param_mcmc.ready
traceplot(chain_pop_param)
end
# ╔═╡ 8de22fbb-5a4d-40dd-a6e3-9d6789d5d923
if param_mcmc.ready
histogram(chain_pop_param, nbins=num_bins)
end
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
[compat]
CSV = "~0.10.4"
DataFrames = "~1.3.4"
Distributions = "~0.25.58"
DynamicPPL = "~0.19.1"
FillArrays = "~0.13.2"
ForwardDiff = "~0.10.30"
HypertextLiteral = "~0.9.4"
LaTeXStrings = "~1.3.0"
MCMCChains = "~5.3.0"
Optim = "~1.7.0"
Plots = "~1.29.0"
PlutoUI = "~0.7.38"
StatsPlots = "~0.14.34"
Tracker = "~0.2.20"
Turing = "~0.21.2"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.7.0"
manifest_format = "2.0"
[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.1.0"
[[deps.AbstractMCMC]]
deps = ["BangBang", "ConsoleProgressMonitor", "Distributed", "Logging", "LoggingExtras", "ProgressLogging", "Random", "StatsBase", "TerminalLoggers", "Transducers"]
git-tree-sha1 = "47aca4cf0dc430f20f68f6992dc4af0e4dc8ebee"
uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
version = "4.0.0"
[[deps.AbstractPPL]]
deps = ["AbstractMCMC", "DensityInterface", "Setfield", "SparseArrays"]
git-tree-sha1 = "6320752437e9fbf49639a410017d862ad64415a5"
uuid = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
version = "0.5.2"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.1.4"
[[deps.AbstractTrees]]
git-tree-sha1 = "03e0550477d86222521d254b741d470ba17ea0b5"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.3.4"
[[deps.Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "af92965fb30777147966f58acb05da51c5616b5f"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.3.3"
[[deps.AdvancedHMC]]
deps = ["AbstractMCMC", "ArgCheck", "DocStringExtensions", "InplaceOps", "LinearAlgebra", "ProgressMeter", "Random", "Requires", "Setfield", "Statistics", "StatsBase", "StatsFuns", "UnPack"]
git-tree-sha1 = "345effa84030f273ee86fcdd706d8484ce9a1a3c"
uuid = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
version = "0.3.5"
[[deps.AdvancedMH]]
deps = ["AbstractMCMC", "Distributions", "Random", "Requires"]
git-tree-sha1 = "5d9e09a242d4cf222080398468244389c3428ed1"
uuid = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
version = "0.6.7"
[[deps.AdvancedPS]]
deps = ["AbstractMCMC", "Distributions", "Libtask", "Random", "StatsFuns"]
git-tree-sha1 = "9ff1247be1e2aa2e740e84e8c18652bd9d55df22"
uuid = "576499cb-2369-40b2-a588-c64705576edc"
version = "0.3.8"
[[deps.AdvancedVI]]
deps = ["Bijectors", "Distributions", "DistributionsAD", "DocStringExtensions", "ForwardDiff", "LinearAlgebra", "ProgressMeter", "Random", "Requires", "StatsBase", "StatsFuns", "Tracker"]
git-tree-sha1 = "e743af305716a527cdb3a67b31a33a7c3832c41f"
uuid = "b5ca4192-6429-45e5-a2d9-87aec30a685c"
version = "0.1.5"
[[deps.ArgCheck]]
git-tree-sha1 = "a3a402a35a2f7e0b87828ccabbd5ebfbebe356b4"
uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197"
version = "2.3.0"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
[[deps.Arpack]]
deps = ["Arpack_jll", "Libdl", "LinearAlgebra", "Logging"]
git-tree-sha1 = "91ca22c4b8437da89b030f08d71db55a379ce958"
uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
version = "0.5.3"
[[deps.Arpack_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"]
git-tree-sha1 = "5ba6c757e8feccf03a1554dfaf3e26b3cfc7fd5e"
uuid = "68821587-b530-5797-8361-c406ea357684"
version = "3.5.1+1"
[[deps.ArrayInterface]]
deps = ["Compat", "IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"]
git-tree-sha1 = "81f0cb60dc994ca17f68d9fb7c942a5ae70d9ee4"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "5.0.8"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.AxisAlgorithms]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7"
uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950"
version = "1.0.1"
[[deps.AxisArrays]]
deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"]
git-tree-sha1 = "cf6875678085aed97f52bfc493baaebeb6d40bcb"
uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
version = "0.4.5"
[[deps.BangBang]]
deps = ["Compat", "ConstructionBase", "Future", "InitialValues", "LinearAlgebra", "Requires", "Setfield", "Tables", "ZygoteRules"]
git-tree-sha1 = "b15a6bc52594f5e4a3b825858d1089618871bf9d"
uuid = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
version = "0.3.36"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[deps.Baselet]]
git-tree-sha1 = "aebf55e6d7795e02ca500a689d326ac979aaf89e"
uuid = "9718e550-a3fa-408a-8086-8db961cd8217"
version = "0.1.1"
[[deps.Bijectors]]
deps = ["ArgCheck", "ChainRulesCore", "ChangesOfVariables", "Compat", "Distributions", "Functors", "InverseFunctions", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "MappedArrays", "Random", "Reexport", "Requires", "Roots", "SparseArrays", "Statistics"]
git-tree-sha1 = "a83abdc57f892576bf1894d558e8a5c35505cdb1"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.10.1"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+0"
[[deps.CEnum]]
git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.4.2"
[[deps.CSV]]
deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings"]
git-tree-sha1 = "873fb188a4b9d76549b81465b1f75c82aaf59238"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.10.4"
[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "4b859a208b2397a7a623a03449e4636bdb17bcf2"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.1+1"
[[deps.Calculus]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
version = "0.5.1"
[[deps.ChainRules]]
deps = ["ChainRulesCore", "Compat", "IrrationalConstants", "LinearAlgebra", "Random", "RealDot", "SparseArrays", "Statistics"]
git-tree-sha1 = "de68815ccf15c7d3e3e3338f0bd3a8a0528f9b9f"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "1.33.0"
[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "9950387274246d08af38f6eef8cb5480862a435f"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.14.0"
[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
git-tree-sha1 = "1e315e3f4b0b7ce40feded39c73049692126cf53"
uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
version = "0.1.3"
[[deps.Clustering]]
deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "SparseArrays", "Statistics", "StatsBase"]
git-tree-sha1 = "75479b7df4167267d75294d14b58244695beb2ac"
uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
version = "0.14.2"
[[deps.CodeInfoTools]]
git-tree-sha1 = "91018794af6e76d2d42b96b25f5479bca52598f5"
uuid = "bc773b8a-8374-437a-b9f2-0e9785855863"
version = "0.3.5"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random"]
git-tree-sha1 = "7297381ccb5df764549818d9a7d57e45f1057d30"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.18.0"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "a985dc37e357a3b22b260a5def99f3530fb415d3"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.2"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"]
git-tree-sha1 = "3f1f500312161f1ae067abe07d13b40f78f32e07"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.9.8"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "417b0ed7b8b838aa6ca0a87aadf1bb9eb111ce40"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.8"
[[deps.Combinatorics]]
git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860"
uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
version = "1.0.2"
[[deps.CommonSolve]]
git-tree-sha1 = "68a0743f578349ada8bc911a5cbd5a2ef6ed6d1f"
uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
version = "0.2.0"
[[deps.CommonSubexpressions]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.3.0"
[[deps.Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "b153278a25dd42c65abbf4e62344f9d22e59191b"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.43.0"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
[[deps.CompositionsBase]]
git-tree-sha1 = "455419f7e328a1a2493cabc6428d79e951349769"
uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b"
version = "0.1.1"
[[deps.ConsoleProgressMonitor]]
deps = ["Logging", "ProgressMeter"]
git-tree-sha1 = "3ab7b2136722890b9af903859afcf457fa3059e8"
uuid = "88cd18e8-d9cc-4ea6-8889-5259c0d15c8b"
version = "0.1.2"
[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f74e9d5388b8620b4cee35d4c5a618dd4dc547f4"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.3.0"
[[deps.Contour]]
deps = ["StaticArrays"]
git-tree-sha1 = "9f02045d934dc030edad45944ea80dbd1f0ebea7"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.7"
[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"
[[deps.DataAPI]]
git-tree-sha1 = "fb5f5316dd3fd4c5e7c30a24d50643b73e37cd40"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.10.0"
[[deps.DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "daa21eb85147f72e41f6352a57fccea377e310a9"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.3.4"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "cc1a8e22627f33c789ab60b36a9132ac050bbf75"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.12"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.DataValues]]
deps = ["DataValueInterfaces", "Dates"]
git-tree-sha1 = "d88a19299eba280a6d062e135a43f00323ae70bf"
uuid = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5"
version = "0.4.13"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DefineSingletons]]
git-tree-sha1 = "0fba8b706d0178b4dc7fd44a96a92382c9065c2c"
uuid = "244e2a9f-e319-4986-a169-4d1fe445cd52"
version = "0.1.2"
[[deps.DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[deps.DensityInterface]]
deps = ["InverseFunctions", "Test"]
git-tree-sha1 = "80c3e8639e3353e5d2912fb3a1916b8455e2494b"
uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
version = "0.4.0"
[[deps.DiffResults]]
deps = ["StaticArrays"]
git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.0.3"
[[deps.DiffRules]]
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "28d605d9a0ac17118fe2c5e9ce0fbb76c3ceb120"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.11.0"
[[deps.Distances]]
deps = ["LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "3258d0659f812acde79e8a74b11f17ac06d0ca04"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.7"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
git-tree-sha1 = "8a6b49396a4058771c5c072239b2e0a76e2e898c"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.58"
[[deps.DistributionsAD]]
deps = ["Adapt", "ChainRules", "ChainRulesCore", "Compat", "DiffRules", "Distributions", "FillArrays", "LinearAlgebra", "NaNMath", "PDMats", "Random", "Requires", "SpecialFunctions", "StaticArrays", "StatsBase", "StatsFuns", "ZygoteRules"]
git-tree-sha1 = "a20d1374e896c72d2598feaf8e86b6d58a0c7d0a"
uuid = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
version = "0.6.39"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.6"
[[deps.Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
[[deps.DualNumbers]]
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
version = "0.6.8"
[[deps.DynamicPPL]]
deps = ["AbstractMCMC", "AbstractPPL", "BangBang", "Bijectors", "ChainRulesCore", "Distributions", "LinearAlgebra", "MacroTools", "Random", "Setfield", "Test", "ZygoteRules"]
git-tree-sha1 = "5d1704965e4bf0c910693b09ece8163d75e28806"
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
version = "0.19.1"
[[deps.EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "3f3a2501fa7236e9b911e0f7a588c657e822bb6d"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.2.3+0"
[[deps.EllipticalSliceSampling]]
deps = ["AbstractMCMC", "ArrayInterface", "Distributions", "Random", "Statistics"]
git-tree-sha1 = "bed775e32c6f38a19c1dbe0298480798e6be455f"
uuid = "cad2338a-1db2-11e9-3401-43bc07c9ede2"
version = "0.5.0"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.4.8+0"
[[deps.FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"