Skip to content

Commit

Permalink
move error message from bias_quantile_single_vector() to `bias_quan…
Browse files Browse the repository at this point in the history
…tile()`
  • Loading branch information
nikosbosse committed Nov 24, 2023
1 parent 64435a3 commit 5f182da
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions R/metrics-quantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,7 @@ bias_quantile <- function(observed, predicted, quantile, na.rm = TRUE) {
)
}
bias <- sapply(1:n, function(i) {
suppressMessages(
bias_quantile_single_vector(observed[i], predicted[i, ], quantile, na.rm)
)
bias_quantile_single_vector(observed[i], predicted[i, ], quantile, na.rm)
})
return(bias)
}
Expand Down Expand Up @@ -445,10 +443,6 @@ bias_quantile_single_vector <- function(observed, predicted, quantile, na.rm) {
median_prediction <- predicted[quantile == 0.5]
} else {
# if median is not available, compute as mean of two innermost quantile
message(
"Median not available, computing bias as mean of the two innermost ",
"quantiles in order to compute bias."
)
median_prediction <-
0.5 * predicted[quantile == max(quantile[quantile < 0.5])] +
0.5 * predicted[quantile == min(quantile[quantile > 0.5])]
Expand Down

0 comments on commit 5f182da

Please sign in to comment.