Skip to content

Commit

Permalink
Fixing the weighted crps.
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalhorton committed Jun 8, 2017
1 parent 317c2b2 commit df490e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/performanceScore.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ crps <- function(x, x0, a=0.44, b=0.12, w=NA) {

n <- length(x)

if (is.na(w)) {
if (length(w) == 1) {
x.s <- sort(x)
r <- 1:n
Fx <- (r - a) / (n + b)
} else {
assert_that(length(Fx) == n)
assert_that(length(w) == n)
sorted <- sort.int(x, index.return=TRUE)
x.s <- sorted$x
w <- w[sorted$ix]
Expand Down

0 comments on commit df490e8

Please sign in to comment.