From 3620da0619ad0939a8e4b54f5edda56b378edf67 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 1 Feb 2024 19:22:43 +1000 Subject: [PATCH] minor bug fix for single series, no covariate prediction --- R/evaluate_mvgams.R | 6 ++++-- R/forecast.mvgam.R | 2 +- src/mvgam.dll | Bin 1084416 -> 1084416 bytes 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/R/evaluate_mvgams.R b/R/evaluate_mvgams.R index 62fed1fa..7b2d0185 100644 --- a/R/evaluate_mvgams.R +++ b/R/evaluate_mvgams.R @@ -664,10 +664,12 @@ drps_score <- function(truth, fc, interval_width = 0.9, if(log){ truth <- log(truth + 0.001) fc <- log(fc + 0.001) + nsum <- max(c(truth, fc), na.rm = TRUE) + 5 + } else { + nsum <- max(c(truth, + quantile(fc, probs = 0.99)), na.rm = TRUE) + 1000 } - #nsum <- 1000 - nsum <- max(c(truth, fc), na.rm = TRUE) + 1000 Fy = ecdf(fc) ysum <- 0:nsum indicator <- ifelse(ysum - truth >= 0, 1, 0) diff --git a/R/forecast.mvgam.R b/R/forecast.mvgam.R index 8cce5b7f..c8a1000d 100644 --- a/R/forecast.mvgam.R +++ b/R/forecast.mvgam.R @@ -811,7 +811,7 @@ forecast_draws = function(object, } # Bind the last 3 linpred rows with the forecast linpred rows - Xp_trend <- rbind(Xp_trend_last[linpred_order, ], + Xp_trend <- rbind(Xp_trend_last[linpred_order, , drop = FALSE], Xp_trend) attr(Xp_trend, 'model.offset') <- full_offset } diff --git a/src/mvgam.dll b/src/mvgam.dll index 54a948f895c34e109aa88fb77569d3b38aa7d78e..a526cf22b208f0121289d49271729a06ae1804e4 100644 GIT binary patch delta 79 zcmWN|yA4240EW?czb@_?N=7h%UTX~1Rs4yl=~} i!V|s-L?|K=i$tU%6S*ja5v8a^ePf&U-%s4xcl-c&H6nxn delta 79 zcmV~$yA4240EW@H-fvp1O34TY(A$RMPees`7ZELUe4D78v)FO5