diagram: Murphy diagrams to visualize forecast comparisons

Description Usage Arguments Value Author(s) References Examples

Description

Visual comparisons of two forecasting methods, allowing to study whether the ranking is robust across the class of elementary or extremal scoring functions. See Ehm et al (2016, esp. Sections 3 and 4) for details.

Usage

1
2
3
4
5
6
7
murphydiagram(f1, f2, y, functional = "expectile", alpha = 0.5, 
labels = c("Method 1", "Method 2"), colors =  NULL, 
equally_spaced = FALSE)

murphydiagram_diff(f1, f2, y, functional = "expectile", 
alpha = 0.5, equally_spaced = FALSE, lag_truncate = 0, 
conf_level = 0.95)

Arguments

f1, f2

Vectors of point forecasts

y

Vector of realizing observations.

functional

Either "expectile" (the default) or "quantile". Note that the probability of a binary event is an expectile at level alpha = 0.5 (see below).

alpha

Level of the expectile or quantile, must be between 0 and 1. Defaults to 0.5, which is the mean (if functional is set to "expecile") or median (if functional is set to "quantile").

labels

Method labels for murphydiagram to be used in plot legend. Character vector of length two, or NULL (in order to omit labels).

colors

Colors used. Defaults to NULL, such that the colors are as in Ehm et al (2016). Alternative colors can be specified as a character vector of length two.

equally_spaced

Method for choosing the grid of values on the horizontal axis. If set to FALSE (the default), the set of points that is relevant for dominance (c.f. Section 3.4 of the paper) is chosen. This can be somewhat time consuming for large data sets. If set to TRUE, an auxiliary grid of equally spaced points is used.

lag_truncate

Largest order of autocorrelation that is accounted for in the variance estimator for murphydiagram_diff (defaults to zero).

conf_level

Level of the confidence bands plotted in murphydiagram_diff, defaults to 0.95.

Value

None, used for the effect of creating a plot. murphydiagram plots the extremal scores of two forecasting methods. murphydiagram_diff plots the difference in the extremal scores of two forecasting methods, together with a confidence interval.

Author(s)

Fabian Krueger

References

Ehm, W., Gneiting, T., Jordan, A. and Krueger, F. (2016): Of Quantiles and Expectiles: Consistent Scoring Functions, Choquet Representations, and Forecast Rankings. Journal of the Royal Statistical Society (Series B) 78, 1-29. doi: 10.1111/rssb.12154 (open access).

Examples

1
2
3
4
5
6
7
8
# Comparison of Inflation Forecasts: Survey of Professional Forecasters (SPF) 
# versus Michigan Survey of Consumers

data(inflation_mean)
murphydiagram(inflation_mean$spf, inflation_mean$michigan, 
inflation_mean$rlz, labels = c("SPF", "Michigan"))
murphydiagram_diff(inflation_mean$spf, inflation_mean$michigan, 
inflation_mean$rlz, lag_truncate = 4)

murphydiagram documentation built on Dec. 6, 2019, 5:12 p.m.