Problems 2.4. State-space models & fusing data

  1. Save and run Exercise_06_StateSpace.Rmd. The code sample is pulling Google flu data for Massachuetts and fitting a random walk to the data. Complete the exercise where you convert the last 40 data points to NA, make a ‘forecast’, that is compared to the real data. Make the zoomed in plots as necessary. [10 marks] (this is mostly tests existing R skills/copy and paste).

  2. The process model,

  #### Process Model
  "for(t in 2:n){
    x[t]~dnorm(x[t-1],tau_add)
  }"

might be extended to include some epidemiological details. Rather than try to change to a very complicated model, as the first step, lets consider:

\(I_{t+1} = I_{t} + \left(\beta - 0.2\right)I_t\).

This is a very simple epidemiological model, where it is assumed that the proportion of susceptible individuals is fixed and equal to 1. This assumption might hold for a short time after a novel pathogen emerges. For this model, \(\beta\) is the transmission rate and the recovery rate is assumed to be estimated with complete certainty as 0.2 recoveries per day. Consider a new process model,

  #### Process Model
  "for(t in 2:n){
    x[t]~dnorm((1+beta_proc-0.2)*x[t-1],tau_add)
  }"

Let’s understand, that x[t] is \(I(t)\), and beta_proc is \(\beta\).

Add to the code, a prior for beta_proc. Run your code. When I tried this, it failed with the error:

Error in update.jags(object, n.iter, ...) : Error in node beta_proc Current value is inconsistent with data

My interpretation of the error message is that if \(\beta\) is not time-varying, then there is no way that my linear recursion equation can fit the flu data, which is fluctuating. This is because the linear recursion equation will produce only geometric growth, or decay, but not both, depending on whether \(\beta > 0.2\) or not.

Try this too. Describe all the changes that you made to the code. Report the errors that you get (or a show a graph of a fit, if you get this to work).

What is the next change that you might make to this exercise to make progress on increasing the epidemiological detail, while also having a model that runs. You are to describe what you would do, but you do not have to do it.

[10 marks]

  1. In Chapter 9, the Ecological forecasting book describes a rigorous approach for fusing data from multiple sources, particularly as it might be relevant for informing priors for parameter estimation. It is also noted that this is rarely. Write a paragraph summarizing the approach that Dietz describes, and outline some of the challenges to realizing these standards for epidemiological modelling.

[5 mark]