I am doing nested (or hierarchical?) cross-validation.
Let's say that I have two model classes M1 and M2, and in each class there are several models with different number of discrete components k (e.g., components in a mixture model).
I want to infer what's the best model class for a given dataset.
I could just have two super-models and do full MCMC directly in the larger space (treating the number of components as discrete parameters), but that's not viable for various reasons.
So, I am computing the posterior, via MCMC, separately for each model class M and number of components k.
The question is, is it okay to use PSIS-LOO twice here?
As far as I understand, I should do something like two nested leave-one-out CV:
- For each model class M,
- For i = 1..N, where N is the number of data points:
- remove the i-th data point from the full dataset.
- Perform PSIS-LOO (or any other method) on the reduced dataset to choose the best number of components.
- Take the best model and now compute the prediction on the left-out i-th data point via PSIS. This yields the i-th LOO-CV score for the model class.
- The LOO-CV score of each model class is the sum (or mean) of 1..N LOO-CV scores from the N reduced datasets.
- Compare the summed scores of the model classes.
Does this make sense, and is there a reference for an usage of this kind? Any non-obvious caveat?
(I was checking
this but it does not seem to cover this case.)
Thanks,
Luigi