Learn R Programming

MetricsWeighted (version 0.5.4)

murphy_diagram: Murphy diagram

Description

Murphy diagram of the elementary scoring function for expectiles resp. quantiles at level alpha for different values of theta. Can be used to study and compare performance of one or multiple models. If the plot needs to be customized, set plot = FALSE to get the resulting data instead of the plot.

Usage

murphy_diagram(
  actual,
  predicted,
  w = NULL,
  alpha = 0.5,
  theta = seq(-2, 2, length.out = 100),
  functional = c("expectile", "quantile"),
  plot = TRUE,
  ...
)

Value

A named list of functions.

Arguments

actual

Observed values.

predicted

Predicted values.

w

Optional case weights.

alpha

Level of expectile resp. quantile. The default alpha = 0.5 corresponds to the expectation resp. median.

theta

Vector of evaluation points.

functional

Either "expectile" or "quantile".

plot

Should plot (TRUE) be returned or the data to be plotted?

...

Further arguments passed to plot.

References

Ehm, W., Gneiting, T., Jordan, A. and Krüger, F. (2016), Of quantiles and expectiles: consistent scoring functions, Choquet representations and forecast rankings. J. R. Stat. Soc. B, 78: 505-562, <doi.org/10.1111/rssb.12154>.

See Also

elementary_score.

Examples

Run this code
y <- 1:10
predicted <- 1.1 * y
murphy_diagram(y, predicted, theta = seq(0.9, 1.2, by = 0.01))
two_models <- cbind(m1 = predicted, m2 = 1.2 * y)
murphy_diagram(y, two_models, theta = seq(0.9, 1.3, by = 0.01))

Run the code above in your browser using DataLab