Kernel: Python 3
In [1]:
Lions and Tigers and Bears
Suppose we visit a wild animal preserve where we know that the only animals are lions and tigers and bears, but we don't know how many of each there are.
During the tour, we see 3 lions, 2 tigers and one bear. Assuming that every animal had an equal chance to appear in our sample, estimate the prevalence of each species.
What is the probability that the next animal we see is a bear?
Grid algorithm
In [2]:
In [3]:
In [4]:
In [5]:
Write a better version of enumerate_triples that doesn't run into problems with floating-point.
In [6]:
In [7]:
In [8]:
In [9]:
In [10]:
In [11]:
In [12]:
In [13]:
Using the Dirichlet object
In [14]:
In [15]:
In [16]:
In [17]:
In [18]:
In [19]:
MCMC
Implement this model using MCMC. You might want to start with this example.
In [20]:
In [21]:
In [30]:
In [22]:
In [23]:
In [24]:
In [25]:
In [26]:
In [27]:
In [28]:
In [29]:
In [ ]: