STAT631-R代写-Assignment 3
时间:2024-03-17
Prof. Rob Deardon STAT 631: Assignment 3 1
STAT 631: Computational Statistics
Assignment 3 2024
Due Monday 5 April, 11:59PM - in Dropbox D2L Folder
Submit Single PDF document ONLY please.
Include your NAME in the PDF filename.
Include all code in your PDF document, as well as any output (e.g. plots) required to
show you have answered the question; make sure graphs/plots are properly labelled.
1. SIR Model – Metropolis-Hastings MCMC
Load the data set epidemic2024A3.csv into R. This data set is the same you used in Assignment
2, consisting of the first 20 days of data. We will be fitting our discrete-time SIR model to it, making
the same assumptions as before; i.e., that the population from which this data was taken is of size
N = 10000, with I1 = 25 and the remaining population wholly susceptible at the first time point at
which data is recorded. Initially, we assume independent uniform priors for our parameters:
β ∼ U [0, 0.5] and γ ∼ U [0, 0.5]
i) Implement a random-walk Metropolis-Hastings (MH) algorithm for estimating the posterior
distribution with the above data using a block update for β and γ. Tune the proposals in your
algorithm so that the algorithm is relatively efficient. Include trace plots, as well as plots of the
marginal AND joint posterior distributions, and report posterior mean estimates and credible
(e.g., percentile) intervals of the parameters.
ii) Repeat i), but use single-parameter independence sampler updates with proposals equal to the
(marginal) priors. Include trace plots, as well as plots of the marginal AND joint posterior
distributions, and report posterior mean estimates and credible (e.g., percentile) intervals of the
parameters.
iii) Repeat ii), but change the single-parameter independent sampler updates to make the MCMC
algorithm as efficient as you can. Once again, include trace plots, as well as plots of the
marginal AND joint posterior distributions, and report posterior mean estimates and credible
(e.g., percentile) intervals of the parameters. Explain how you know this algorithm is more
efficient than that in (ii).
2 STAT 631: Assignment 3 Prof. Rob Deardon
2. SIR Model – Data-augmented MCMC
We are now going to imagine that two of the data points we have in our data set were not observed.
Specifically, we shall assume that we do not know the number of new cases on day 7, and the number
of removals on day 14.
Implement data augmented MCMC to sample from the joint posterior of the model parameters and
the two missing data points above. We will assume we have no a priori information about the two
missing data points.
Show trace plots of the model and missing data parameters, and summarize both numerically and
graphically information about the four marginal posterior distributions for our model and missing
data parameters.
3. SIR Model – Parametric Bootstrap Confidence Intervals
Returning to the complete data set of Question 1, find maximum likelihood estimates for the param-
eters of our discrete-time SIR model. Using these estimates, derive parametric bootstrap-based 95%
percentile confidence intervals for the two model parameters.
Compare these intervals with 95% percentile credible intervals for each of the two model parameters
using your analysis from Question 1, part (i). Explain any similarities or differences you see.


essay、essay代写