Skip to content

Reduce messages for bias_quantile() #500

@nikosbosse

Description

@nikosbosse

Currently, bias_quantile() uses an internal helper function, bias_quantile_single_vector() to compute bias for a single forecast.

This helper functions throws a message if the median is not part of the quantile levels provided. That means that a single call to bias_quantile() can produce a lot of messages, as the message is repeated every time the helper is called. I.e. this:

observed <- c(1, -15, 22)
predicted <- rbind(
  c(-1, 0, 1, 2, 3),
  c(-2, 1, 2, 2, 4),
  c(-2, 0, 3, 3, 4)
)
quantile <- c(0.1, 0.25, 0.5, 0.75, 0.9)

bias_quantile(observed, predicted[, -3], quantile[-3])

produces three messages. I propose to move the message from the helper function to bias_quantile(), thus only getting one message for a single call to bias_quantile().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions