Untitled

 avatar
unknown
plain_text
3 months ago
558 B
10
Indexable
Problem 1
# Solution goes here
hypos = [6, 8, 12]

#prior distribution
prior = Pmf(1/3, hypos)
prior

likelihood = [0, pow(1/8, 4), pow(1/12, 4)]

#updated distribution
posterior = prior * likelihood
posterior.normalize()
posterior[8]

Problem 2
# Solution goes here
hypos = [4, 6, 8, 12, 20]
hypos_counts = [1, 2, 3, 4, 5]

#prior distribution
prior = Pmf(hypos_counts, hypos)
prior.normalize()
prior

likelihood = [0, 0, 1/8, 1/12, 1/20]

#updated distribution
posterior = prior * likelihood
posterior.normalize()
posterior[8]
Editor is loading...
Leave a Comment