this
\pi( y_i | y)
is 'po' and is computed if you request it.
> r=inla(y ~ 1, data=data.frame(y=1:2), control.compute=list(po=TRUE))
> r$po$po
[1] 0.4086249594 0.
4086249594
On Tue, 2022-09-13 at 21:14 -0700, Noah Silverman wrote:
> As noted in my previous posts, I'm looking for ways to evaluate
> goodness-of-fit for out-of-sample testing data.
>
> The CPO and PIT are great, but impossible to evaluate for NA values in
> INLA.
>
> Reading through an old paper "Posterior and Cross-validatory
> Predictive Checks: A Comparison of MCMC and INLA", the authors discuss
> model criticism and comparison.
>
> On page 94 (5th page of actual PDF), the authors describe the
> Posterior Predictive Density.
>
> Screen Shot 2022-09-14 at 12.06.32.png
>
> Intuitively this makes sense. Instead of just comparing the center of
> predicted values to the observed values, we can compare at the entire
> predictive distribution to the observed value.
>
> However, I'm a bit stuck on how to actually calculate this in R.
>
> I can't figure out how to calculate the first term of the left hand
> side
> Screen Shot 2022-09-14 at 12.08.52.png
>
> The dnorm() command in R requires both a mean and standard deviation.
> INLA supplies 48 points from the marginal fitted distribution. How do
> I calculate the above values with those points?
>
> Alternately: Perhaps I'm going about this the "long way", when there
> may be existing tools or function in R. Any suggestions would be very
> welcome.
>
>
> Thank You,
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/r-inla-discussion-group/49d33947-413e-487a-a6f1-67e181f0eb10n%40googlegroups.com
> .