View source: R/murphy_diagram.R
murphy_diagram | R Documentation |
Murphy diagram of the elementary scoring function for expectiles/quantiles at level
\alpha
for different values of \theta
. Can be used to study and
compare performance of one or multiple models.
murphy_diagram(
actual,
predicted,
w = NULL,
alpha = 0.5,
theta = seq(-2, 2, length.out = 100L),
functional = c("expectile", "quantile"),
plot = TRUE,
...
)
actual |
Observed values. |
predicted |
Predicted values. |
w |
Optional case weights. |
alpha |
Level of expectile or quantile. The default |
theta |
Vector of evaluation points. |
functional |
Either "expectile" or "quantile". |
plot |
Should a plot be returned (default is |
... |
Further arguments passed to |
If the plot needs to be customized, set plot = FALSE
to get the
resulting data instead of the plot.
The result of graphics::matplot()
or a data.frame
containing the results.
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>.
elementary_score()
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.