Skip to content

Commit

Permalink
try to fix doc example error
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxd3 committed Oct 1, 2024
1 parent bceb510 commit c177271
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using AbstractMCMC
using AbstractPPL
using BangBang
using Distributions
using Documenter
using Random

Expand Down
14 changes: 8 additions & 6 deletions docs/src/state_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ using Random # hide
using AbstractMCMC: AbstractMCMC # hide
using AbstractPPL: AbstractPPL # hide
using BangBang: constructorof # hide
using AbstractPPL: AbstractPPL
```

```@example gibbs_example
Expand Down Expand Up @@ -493,11 +492,14 @@ samples = sample(
Then we can extract the samples and compute the mean of the samples.

```@example gibbs_example
mu_samples = [sample.values.mu for sample in samples][20001:end]
tau2_samples = [sample.values.tau2 for sample in samples][20001:end]
mean(mu_samples)
mean(tau2_samples)
warmup = 5000
thin = 10
thinned_samples = samples[(warmup + 1):thin:end]
mu_samples = [sample.values.mu for sample in thinned_samples]
tau2_samples = [sample.values.tau2 for sample in thinned_samples]
mu_mean = only(mean(mu_samples))
tau2_mean = only(mean(tau2_samples))
(mu_mean, tau2_mean)
```

Expand Down

0 comments on commit c177271

Please sign in to comment.