Skip to content

Commit

Permalink
Merge pull request #1714 from avehtari/fix_loo_R2
Browse files Browse the repository at this point in the history
fix misplaced paren in .loo_R2
  • Loading branch information
paul-buerkner authored Nov 27, 2024
2 parents 9a711d2 + 76ca249 commit 1277fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/loo_predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ loo_R2.brmsfit <- function(object, resp = NULL, summary = TRUE,
rowSums(sweep(weights, 2, y, FUN = "*"))^2)
var_err_loo <- (N / (N - 1)) *
(rowSums(sweep(weights, 2, err_loo^2, FUN = "*")) -
rowSums(sweep(weights, 2, err_loo, FUN = "*")^2))
rowSums(sweep(weights, 2, err_loo, FUN = "*"))^2)

out <- unname(1 - var_err_loo / var_y)
out[out < -1] <- -1
Expand Down

0 comments on commit 1277fd7

Please sign in to comment.