Question: quick note: here we took the same prior for 1 and 2 . One can consider different priors. For example, if we believe that sometime
quick note: here we took the same prior for and One can consider different priors. For
example, if we believe that sometime around week the pattern changed, then we can define
different values of considering separate averages for one for and the other for
But, be aware that this will have a minimal effect on our final conclusion.
Our model has parameters, ; and We are going to find the posterior of these three
parameters to infer that how much we believe in the change in Bob's tweeting pattern and when
is the most likely week for this change?
e Use numpy.linspace to create two variables with array in the interval of and These
variables are defined as the model space that we want to search for posterior of and You
have also defined an array in part a which shows the week number. This provides a space for
Consider all these points as a D meshgrid, how can we find posterior for each point in the D
space given all the information you have? Use Bayes' theorem to elaborate your method in detail.
f Write a code to find marginalizedposterior for and Plot posteriors for and in
the same figure and create a bar plot for posterior of in a separate figure. Running your code
for this part may take a long time since you compute posterior for every single point in your
model space. However, we will learn more efficient way, Markov chain Monte Carlo MCMC
later in the next homework.
g How is your belief updated about a sudden change in Bob's tweeting habit? Can you estimate
the week when tweeting pattern changed? Use marginalized D posteriors of and to obtain
This shows the probability that Bob's weekly tweet counts has increased by five
at some point.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
