Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
goedman committed Jan 28, 2024
2 parents 352260e + 2fba67c commit 22b339f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions notebooks/Chapter_02.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,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;
Expand All @@ -71,8 +71,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;
Expand All @@ -90,8 +90,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;
Expand Down

0 comments on commit 22b339f

Please sign in to comment.