mrc-ide / drjacoby

Flexible Markov chain monte carlo via reparameterization
https://mrc-ide.github.io/drjacoby/
Other
12 stars 5 forks source link

Switch function likelihood method #105

Open bobverity opened 2 years ago

bobverity commented 2 years ago

Sometimes there are intermediate outputs calculated within the likelihood that we want to access from our posterior draws, e.g. model expectations, splines etc. A workaround is to write the likelihood in such a way that output can switch between returning the raw loglikelihood and these intermediate values. This function can then be run directly within R on MCMC output to get model predictions without having to duplicate this calculation, which could introduce errors.

Write vignette to demonstrate this approach on simple model.