Please submit your homework report to Canvas, including both the Rmarkdown (.Rmd) source file and an HTML file compiled from it. If necessary, you can submit other files needed for your Rmd file to compile, but please do not submit a copy of the data. Your Rmd file can read in the Consett measles data from the internet, via

read.csv("https://kingaa.github.io/sbied/stochsim/Measles_Consett_1948.csv") 

Your report should contain a reference section listing sources. The grader should be able to clearly identify where the sources were used, for example using reference numbers in the text. Anything and anyone consulted while you are working on the homework counts as a source and should be credited. The homework will be graded following the grading scheme in the syllabus.

This homework is conceptually quite simple, but involves overcoming various technical hurdles. The hurdles may be overcome quite quickly, or could turn into a longer battle. To make progress on statistical inference for POMP models, we have to solve these underlying computational issues. If technical difficulties arise, do not wait long before asking your colleagues, coming to office hours, or posting on Piazza.


Installing the pomp package


Homework questions

Question 6.1. Exploring behavior of a POMP model: simulating an SIR process.

Write a solution to Exercise 2.3 from Chapter 12 (Simulation of stochastic dynamic models). Note the following:

readr::read_csv("https://kingaa.github.io/sbied/stochsim/Measles_Consett_1948.csv") |>
  dplyr::select(week,reports=cases) -> meas

Question 6.2. Modifying a POMP model: Adding a latent period to the SIR model

Write a solution to Exercise 2.4 from Chapter 12 (Simulation of stochastic dynamic models).

You should use Csnippets for this. It should not require techniques beyond those developed in Chapter 12. However, if you are interested in learning more about writing compiled C code for R, you can look at the R extensions manual. The section on distribution functions is particularly relevant.


Acknowledgements

The questions derive from material in a short course on Simulation-based Inference for Epidemiological Dynamics