I tried the following in test_shortcuts.R
looE <- loo(modh)
looEtest <- sapply(seq_len(ncol(Yh)),
function(y) sapply(seq_len(nrow(Yh)),
function(x){Ytilde <- Yh
Ytilde[x,y] <- looE[x,y]
Ytilde[y,x] <- looE[x,y]
predict_ij(Ytilde, Hkh, Hkh, x, y) }
)
)
If I do so, all loo predictions are correctly calculated, except for the values on the diagonal. This is currently solved by simply ignoring the diagonal :
looE <- loo(modh)
looEtest <- sapply(seq_len(ncol(Yh)),
function(y) sapply(seq_len(nrow(Yh)),
function(x){Ytilde <- Yh
Ytilde[x,y] <- looE[x,y]
Ytilde[y,x] <- looE[x,y]
if(x == y) Ytilde[x,y] else
predict_ij(Ytilde, Hkh, Hkh, x, y) }
)
)
Is this enough or is there something going wrong in that procedure?
I tried the following in test_shortcuts.R
If I do so, all loo predictions are correctly calculated, except for the values on the diagonal. This is currently solved by simply ignoring the diagonal :
Is this enough or is there something going wrong in that procedure?