From 331202460131547e4c10d990c2d1395678f38da7 Mon Sep 17 00:00:00 2001 From: Rob Hyndman Date: Wed, 13 Nov 2024 16:38:47 +1100 Subject: [PATCH] Allow for multiple distributions --- R/surprisals.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/surprisals.R b/R/surprisals.R index c7b1eaf..6a14d53 100644 --- a/R/surprisals.R +++ b/R/surprisals.R @@ -106,7 +106,7 @@ surprisals.default <- function( den <- den[[1]] } scores <- -den - if (loo & stats::family(distribution) == "kde") { + if (loo & all(stats::family(distribution) == "kde")) { n <- NROW(object) d <- NCOL(object) if (d == 1L) {