@@ -173,7 +173,7 @@ fc_with_intervals <- forecast(
173173 seed = 42
174174 ),
175175 horizon = 1:12,
176- levels = c(0.50, 0.80 , 0.95),
176+ levels = c(0.50, 0.90 , 0.95),
177177 include_median = FALSE,
178178 model_name = "Constant"
179179)
@@ -191,6 +191,7 @@ library(hubVis)
191191hubVis::plot_step_ahead_model_output(
192192 constant_hubverse$model_output,
193193 constant_hubverse$target_data,
194+ intervals = c(0.5, 0.9, 0.95),
194195 interactive = TRUE
195196)
196197```
@@ -209,7 +210,7 @@ arma_fc <- forecast(
209210 arma_fitted,
210211 interval_method = EmpiricalInterval(n_trajectories = 1000),
211212 horizon = 1:12,
212- levels = c(0.50, 0.80 , 0.95),
213+ levels = c(0.50, 0.90 , 0.95),
213214 include_median = FALSE,
214215 model_name = "ARMA(2,1)"
215216)
@@ -226,13 +227,14 @@ arma_hubverse <- as_hubverse(
226227hubVis::plot_step_ahead_model_output(
227228 arma_hubverse$model_output,
228229 arma_hubverse$target_data,
230+ intervals = c(0.5, 0.9, 0.95),
229231 interactive = TRUE
230232)
231233```
232234
233235The hubVis visualizations show:
234236
235- - Prediction intervals at 50%, 80 %, and 95% confidence levels
237+ - Prediction intervals at 50%, 90 %, and 95% confidence levels
236238- Observed truth values overlaid on the forecasts
237239
238240# Model Evaluation
@@ -259,7 +261,7 @@ forecasts <- lapply(names(models), function(name) {
259261 forecast(fitted,
260262 interval_method = EmpiricalInterval(n_trajectories = 1000),
261263 horizon = 1:12,
262- levels = c(0.50, 0.80 , 0.95),
264+ levels = c(0.50, 0.90 , 0.95),
263265 include_median = FALSE,
264266 model_name = name
265267 )
@@ -277,13 +279,13 @@ all_quantiles <- scoringutils::as_forecast_quantile(all_quantiles)
277279scores <- scoringutils::score(all_quantiles)
278280score_summary <- scoringutils::summarise_scores(scores, by = "model")
279281
280- # Display key metrics (WIS decomposition)
282+ # Display key metrics
281283comparison <- data.frame(
282284 Model = score_summary$model,
283285 WIS = round(score_summary$wis, 2),
284- Dispersion = round(score_summary$dispersion, 2 ),
285- Underprediction = round(score_summary$underprediction, 2 ),
286- Overprediction = round(score_summary$overprediction, 2 )
286+ Coverage_50 = paste0( round(score_summary$interval_coverage_50 * 100, 1), "%" ),
287+ Coverage_90 = paste0( round(score_summary$interval_coverage_90 * 100, 1), "%" ),
288+ Coverage_95 = paste0( round(score_summary$interval_coverage_95 * 100, 1), "%" )
287289)
288290print(comparison)
289291
@@ -300,6 +302,7 @@ comparison_hubverse <- as_hubverse(
300302hubVis::plot_step_ahead_model_output(
301303 comparison_hubverse$model_output,
302304 comparison_hubverse$target_data,
305+ intervals = c(0.5, 0.9, 0.95),
303306 interactive = TRUE
304307)
305308```
@@ -324,7 +327,7 @@ stl_fitted <- fit_baseline(seasonal_data, stl_model)
324327stl_fc <- forecast(stl_fitted,
325328 interval_method = EmpiricalInterval(n_trajectories = 1000),
326329 horizon = 1:12,
327- levels = c(0.50, 0.80 , 0.95),
330+ levels = c(0.50, 0.90 , 0.95),
328331 include_median = FALSE,
329332 truth = future_seasonal,
330333 model_name = "STL"
@@ -336,7 +339,7 @@ lsd_fitted <- fit_baseline(seasonal_data, lsd_model)
336339lsd_fc <- forecast(lsd_fitted,
337340 interval_method = EmpiricalInterval(n_trajectories = 1000),
338341 horizon = 1:12,
339- levels = c(0.50, 0.80 , 0.95),
342+ levels = c(0.50, 0.90 , 0.95),
340343 include_median = FALSE,
341344 truth = future_seasonal,
342345 model_name = "LSD"
@@ -364,6 +367,7 @@ filtered_output <- seasonal_hubverse$model_output[seasonal_hubverse$model_output
364367hubVis::plot_step_ahead_model_output(
365368 filtered_output,
366369 filtered_target,
370+ intervals = c(0.5, 0.9, 0.95),
367371 interactive = TRUE
368372)
369373```
0 commit comments