From 7a19778dc1a4f6f325937e94019953b7c5a3024e Mon Sep 17 00:00:00 2001 From: Hannes Becher Date: Tue, 2 May 2023 09:06:31 +0100 Subject: [PATCH] typo fix --- notebooks/Chapter_02.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/notebooks/Chapter_02.jl b/notebooks/Chapter_02.jl index 245394f..adfc813 100644 --- a/notebooks/Chapter_02.jl +++ b/notebooks/Chapter_02.jl @@ -51,8 +51,8 @@ let size = 20 p_grid = range(0, 1; length=size) prior = ones(size) - likelyhood = [pdf(Binomial(9, p), 6) for p in p_grid] - unstd_posterior = likelyhood .* prior + likelihood = [pdf(Binomial(9, p), 6) for p in p_grid] + unstd_posterior = likelihood .* prior posterior = unstd_posterior / sum(unstd_posterior) plot(p_grid, posterior; @@ -70,8 +70,8 @@ let size = 20 p_grid = range(0, 1; length=size) prior = convert(Vector{AbstractFloat}, p_grid .>= 0.5) - likelyhood = [pdf(Binomial(9, p), 6) for p in p_grid] - unstd_posterior = likelyhood .* prior + likelihood = [pdf(Binomial(9, p), 6) for p in p_grid] + unstd_posterior = likelihood .* prior posterior = unstd_posterior / sum(unstd_posterior) plot(p_grid, posterior; @@ -89,8 +89,8 @@ let size = 20 p_grid = range(0, 1; length=size) prior = exp.(-5*abs.(p_grid .- 0.5)) - likelyhood = [pdf(Binomial(9, p), 6) for p in p_grid] - unstd_posterior = likelyhood .* prior + likelihood = [pdf(Binomial(9, p), 6) for p in p_grid] + unstd_posterior = likelihood .* prior posterior = unstd_posterior / sum(unstd_posterior) plot(p_grid, posterior;