Skip to content

Commit ad9e529

Browse files
rdiaz02yebaidevmotion
authored
Fix expectation of s² and m in gdemo (#1927)
* Fix expectation of s² and m in gdemo The expectation of m cannot be anything different from 0, given the definition. Likewise for an inverse gamma random variable. Former sentence, "the expectation of s is 49/24 (2.04166666...) and the expectation of m is 7/6 (1.16666666...)." cannot be correct. * Update docs/src/using-turing/guide.md Co-authored-by: Ramon Diaz-Uriarte <[email protected]> * Update docs/src/using-turing/guide.md Co-authored-by: David Widmann <[email protected]> Co-authored-by: Hong Ge <[email protected]> Co-authored-by: David Widmann <[email protected]>
1 parent f9353f0 commit ad9e529

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/src/using-turing/guide.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ end
4242
```
4343

4444

45-
Note: As a sanity check, the expectation of `s` is 49/24 (2.04166666...) and the expectation of `m` is 7/6 (1.16666666...).
45+
Note: As a sanity check, the prior expectation of `` is `mean(InverseGamma(2, 3)) = 3/(2 - 1) = 3` and the prior expectation of `m` is 0. This can be easily checked using `Prior`:
46+
47+
```julia
48+
p1 = sample(gdemo(missing, missing), Prior(), 100000)
49+
```
50+
4651

4752

4853
We can perform inference by using the `sample` function, the first argument of which is our probabilistic program and the second of which is a sampler. More information on each sampler is located in the [API]({{site.baseurl}}/docs/library).

0 commit comments

Comments
 (0)