I am running 3 different latent variable models, and I now want to compare them to see which best represents the structure of the data. However, when I try to calculate loo for a model I get the following error:
Error in while (t < nrow(acov) - 5 && !is.nan(rho_hat_even + rho_hat_odd) && : missing value where TRUE/FALSE needed In addition: Warning message: NAs were found in the log-likelihood. Possibly this is because some of your responses contain NAs. If you use 'mi' terms, try setting 'resp' to those response variables without missing values. Alternatively, use 'newdata' to predict only complete cases.
I get a similar message when computing WAIC.
I am using mi terms to model the latent variable, but it is not clear to me where the resp should go?
I had read somewhere on this forum (although I can no longer find it sorry) that computing loo with mi() model terms was inappropriate. So perhaps I should be using alternative model comparison statistics.
Are there alternative model comparison statistics I could use here?
- Operating System: Mac OSX 10.15.7
- brms Version: 2.14.4