Compare models with k-fold cv

Thanks for asking! I only now realized that there is an error in that article!

In the article loo is called also for logliks from k-folf-cross-validation which doesn’t make sense.

Neither loo nor kfold compute effective number of parameters directly and p_eff shown in loo output is just something which is computed afterwards for additional diagnostic value.

Using the function you included, this is the correct thing to do.

For comparison, it is better to use pointwise values. If you form the structure correctly you could use loo_compare function to compute elpd_diff’s and SE of the pointwise difference