CDCgov / ww-inference-model

An in-development R package and a Bayesian hierarchical model jointly fitting multiple "local" wastewater data streams and "global" case count data to produce nowcasts and forecasts of both observations
https://cdcgov.github.io/ww-inference-model/
Apache License 2.0
16 stars 2 forks source link

Slight tweak to the centered code #47

Closed kaitejohnson closed 2 months ago

kaitejohnson commented 2 months ago

I now realize why this was very confusing! Because when you do the non-centered parameterization, you generate expectations of the observed data, and these expectations become the mean of your observation model (and I chose normally distributed observation noise here, though I am not sure that is necessarily best practice).

For the centered paramaterization, you want to write the model in the exact way you are simulating the data which is that:

$$\epsilon_t \sim MVN(0, \Sigma)$$

Where $\Sigma$ is just a function of the data (distance matrix) and the correlation function parameters (phi and sigma_eps). In this case, you do not have to parameterize the "noise matrix" or the realized draws from the iid normals, because they will go directly into your observation model as part of the likelihood function.