Hi!
I would like to know if it’s possible to have positive and negative values when we compare different models using the \texttt{loo_compare()} function, specifically in \texttt{elpd_diff}.
I read this thread Positive values for elpd_loo? but still I’m a little confused about the answer exposed there.
The context is the following; I’m comparing 4 spatial models, 2 of them assuming a Gamma response and the others 2 assuming a Skew normal response. So, one of the metrics to determine which model is better (based on the predictive performance), is estimate the difference in their expected predictive accuracy.
To do a correct comparison of the models, I applied the Jacobian correction to the Skew normal models, in this example, for \texttt{loo_2} and \texttt{loo_4}:
loo_1 = loo(log_lik_1, cores = no_cores)
loo_2 = loo(log_lik_2, cores = no_cores)
loo_3 = loo(log_lik_3, cores = no_cores)
loo_4 = loo(log_lik_4, cores = no_cores)
loo_2_with_jacobian <- loo_2
loo_2_with_jacobian$pointwise[,1] <- loo_2_with_jacobian$pointwise[,1] - log(2*sqrt(data$y))
loo_4_with_jacobian <- loo_4
loo_4_with_jacobian$pointwise[,1] <- loo_4_with_jacobian$pointwise[,1] - log(2*sqrt(data$y))
comp <- loo_compare(loo_1, loo_2_with_jacobian, loo_3, loo_4_with_jacobian)
print(comp, digits = 2)
Where log(2*sqrt(data$y))
is the Jacobian correction for the transformed response variable (\sqrt{y}) in the Skew normal models. The comparative results are the following:
elpd_diff se_diff elpd_loo se_elpd_loo p_loo se_p_loo looic se_looic
model4 0.00 0.00 -7160.01 56.88 37.82 2.34 14320.03 113.76
model2 -42.08 12.28 -7202.09 57.02 27.86 1.52 14404.18 114.04
model1 51.04 25.25 -16846.08 60.94 45.16 3.55 33692.16 121.89
model3 44.29 23.84 -16852.83 60.93 41.36 3.45 33705.67 121.86
Looking at the previous results, “model4” is the best model based on the predictive performance. However, the next “best” model is “model2” but it has a negative value and the rest have positive values. The other quantities of interest like \texttt{elpd_loo } or \texttt{se_elpd_loo} are more reasonables in the comparison, but still I’m intrigued about that negative value of “model2”.
Someone could help me to understand why this is happening? Maybe some theoretical aspect that I’m not considering?
Note: Unfortunately, the codes are written in \texttt{TMB} and for the inference I’m using \texttt{tmbstan}, so it could not be much of help here. However, if you need to understand the models themselves, happy to give more explanation of them
Thank you in advance!