Skip to content

Commit

Permalink
Merge 59cb370 into ae82ca2
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosbosse authored Mar 2, 2023
2 parents ae82ca2 + 59cb370 commit 17f23a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: scoringutils
Title: Utilities for Scoring and Assessing Predictions
Version: 1.1.0
Version: 1.1.1
Language: en-GB
Authors@R: c(
person(given = "Nikos",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# scoringutils 1.1.1

- added a small change to `interval_score()` which explicitly converts the logical vector to a numeric one. This should happen implicitly anyway, but is now done explicitly in order to avoid issues that may come up if the input vector has a type that doesn't allow the implict conversion.

# scoringutils 1.1.0

A minor update to the package with some bug fixes and minor changes.
Expand Down
6 changes: 4 additions & 2 deletions R/interval_score.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ interval_score <- function(true_values,

# calculate three components of WIS
dispersion <- (upper - lower)
overprediction <- 2 / alpha * (lower - true_values) * (true_values < lower)
underprediction <- 2 / alpha * (true_values - upper) * (true_values > upper)
overprediction <-
2 / alpha * (lower - true_values) * as.numeric(true_values < lower)
underprediction <-
2 / alpha * (true_values - upper) * as.numeric(true_values > upper)

if (weigh) {
dispersion <- dispersion * alpha / 2
Expand Down

0 comments on commit 17f23a7

Please sign in to comment.