I’m still not completely sure what you meant but I tried a few options.
For these runs the R2 priors are:
R2D2_mean_R2 = 0.6, R2D2_prec_R2 = 15, R2D2_cons_D2 = c(1.5, 1.5, 0.5)
Here are the errors messages and some pairs plots from the model above so with this likelihood:
V = add_diag( lambda * exp(-cov_Kzr(Zc, r)) , delta );
// GP
target += multi_normal_cholesky_lpdf(F | rep_vector(0, n_obs), cholesky_decompose(V));
// Likelihood
if (!prior_only) {
target += bernoulli_logit_glm_lupmf(y | Xc, Intcpt + F, beta);
}
I first tried changing it as follows:
// GP
target += multi_normal_cholesky_lpdf(F | Intcpt + Xc * beta, cholesky_decompose(V));
// Likelihood
if (!prior_only) {
target += bernoulli_logit_lpmf(y | inv_logit(F));
}
This was worse:
Then I tried changing it as follows (which I think is what you intended in your previous comment @avehtari ?)
V = add_diag( lambda * exp(-cov_Kzr(Zc, r)) , delta ) +
(Intcpt + Xc*beta) * to_row_vector(Intcpt + Xc*beta) .* identity_matrix(n_obs);
target += multi_normal_cholesky_lpdf(F | rep_vector(0, n_obs), cholesky_decompose(V));
target += bernoulli_logit_lupmf(y | inv_logit(F));
This was worse again (and again I changed nothing else between these runs):
I am somewhat at a loss what to try next. The first model is clearly less pathologic than the other two, but having tried many different priors, increasing iterations, larger datasets, I cannot quite quosh the EMFI warnings. Any thoughts anyone?