Skip to content

Commit

Permalink
minor bug fix for single series, no covariate prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Feb 1, 2024
1 parent 30524cd commit 3620da0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions R/evaluate_mvgams.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/forecast.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Binary file modified src/mvgam.dll
Binary file not shown.

0 comments on commit 3620da0

Please sign in to comment.