From c403bac69ce428baa8ccaeaafe0a3d63a8d8a401 Mon Sep 17 00:00:00 2001 From: Rik Huijzer <20724914+rikhuijzer@users.noreply.github.com> Date: Sat, 24 Oct 2020 14:27:04 +0200 Subject: [PATCH] Fix the calculation for the updated belief The order was reversed as could be seen by computing the posterior distribution for one heads or one tails. --- _tutorials/0_Introduction.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_tutorials/0_Introduction.md b/_tutorials/0_Introduction.md index 1032e8ec0..4a658f2d5 100644 --- a/_tutorials/0_Introduction.md +++ b/_tutorials/0_Introduction.md @@ -200,7 +200,8 @@ Now we can build our plot: # Compute the posterior distribution in closed-form. N = length(data) heads = sum(data) -updated_belief = Beta(prior_belief.α + heads, prior_belief.β + N - heads) +tails = N - heads +updated_belief = Beta(prior_belief.α + tails, prior_belief.β + heads) # Visualize a blue density plot of the approximate posterior distribution using HMC (see Chain 1 in the legend). p = plot(p_summary, seriestype = :density, xlim = (0,1), legend = :best, w = 2, c = :blue)