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.
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.