File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
using AbstractMCMC
2
+ using AbstractPPL
3
+ using BangBang
4
+ using Distributions
2
5
using Documenter
3
6
using Random
4
7
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ using Random # hide
49
49
using AbstractMCMC: AbstractMCMC # hide
50
50
using AbstractPPL: AbstractPPL # hide
51
51
using BangBang: constructorof # hide
52
- using AbstractPPL: AbstractPPL
53
52
```
54
53
55
54
``` @example gibbs_example
@@ -493,11 +492,14 @@ samples = sample(
493
492
Then we can extract the samples and compute the mean of the samples.
494
493
495
494
``` @example gibbs_example
496
- mu_samples = [sample.values.mu for sample in samples][20001:end]
497
- tau2_samples = [sample.values.tau2 for sample in samples][20001:end]
498
-
499
- mean(mu_samples)
500
- mean(tau2_samples)
495
+ warmup = 5000
496
+ thin = 10
497
+ thinned_samples = samples[(warmup + 1):thin:end]
498
+ mu_samples = [sample.values.mu for sample in thinned_samples]
499
+ tau2_samples = [sample.values.tau2 for sample in thinned_samples]
500
+
501
+ mu_mean = only(mean(mu_samples))
502
+ tau2_mean = only(mean(tau2_samples))
501
503
(mu_mean, tau2_mean)
502
504
```
503
505
You can’t perform that action at this time.
0 commit comments