From 6b6a8c25f74b621c2074efb499a6a82a2db863dd Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Sat, 4 Nov 2023 10:10:09 +0100 Subject: [PATCH] Update examples and vignette such that examples don't have any more instances where the lower bound of an interval is higher than an upper bound --- R/metrics-range.R | 4 ++-- man/interval_score.Rd | 4 ++-- vignettes/scoring-forecasts-directly.Rmd | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/metrics-range.R b/R/metrics-range.R index a1185e1ba..5263d8962 100644 --- a/R/metrics-range.R +++ b/R/metrics-range.R @@ -63,7 +63,7 @@ #' interval_range <- rep(90, 30) #' alpha <- (100 - interval_range) / 100 #' lower <- qnorm(alpha / 2, rnorm(30, mean = 1:30)) -#' upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 1:30)) +#' upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 11:40)) #' #' interval_score( #' observed = observed, @@ -73,7 +73,7 @@ #' ) #' #' # gives a warning, as the interval_range should likely be 50 instead of 0.5 -#' interval_score(observed = 4, upper = 2, lower = 8, interval_range = 0.5) +#' interval_score(observed = 4, upper = 8, lower = 2, interval_range = 0.5) #' #' # example with missing values and separate results #' interval_score( diff --git a/man/interval_score.Rd b/man/interval_score.Rd index 9232fde21..9c0f4c567 100644 --- a/man/interval_score.Rd +++ b/man/interval_score.Rd @@ -80,7 +80,7 @@ observed <- rnorm(30, mean = 1:30) interval_range <- rep(90, 30) alpha <- (100 - interval_range) / 100 lower <- qnorm(alpha / 2, rnorm(30, mean = 1:30)) -upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 1:30)) +upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 11:40)) interval_score( observed = observed, @@ -90,7 +90,7 @@ interval_score( ) # gives a warning, as the interval_range should likely be 50 instead of 0.5 -interval_score(observed = 4, upper = 2, lower = 8, interval_range = 0.5) +interval_score(observed = 4, upper = 8, lower = 2, interval_range = 0.5) # example with missing values and separate results interval_score( diff --git a/vignettes/scoring-forecasts-directly.Rmd b/vignettes/scoring-forecasts-directly.Rmd index d7a68736f..9272f5d27 100644 --- a/vignettes/scoring-forecasts-directly.Rmd +++ b/vignettes/scoring-forecasts-directly.Rmd @@ -207,7 +207,7 @@ observed <- rnorm(30, mean = 1:30) interval_range <- 90 alpha <- (100 - interval_range) / 100 lower <- qnorm(alpha / 2, rnorm(30, mean = 1:30)) -upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 1:30)) +upper <- qnorm((1 - alpha / 2), rnorm(30, mean = 11:40)) interval_score( observed = observed,