bregman2_sf {scoringfunctions}R Documentation

Bregman scoring function (type 2, Patton scoring function)

Description

The function bregman2_sf computes the Bregman scoring function when y materializes and x is the predictive mean functional.

The Bregman scoring function is defined by eq. (18) in Gneiting (2011) and the form implemented here for \phi(x) = \dfrac{1}{b (b - 1)} x^b, b \in \R \setminus \lbrace 0, 1 \rbrace is defined by eq. (20) in Gneiting (2011).

Usage

bregman2_sf(x, y, b)

Arguments

x

Predictive mean functional (prediction). It can be a vector of length n (must have the same length as y).

y

Realization (true value) of process. It can be a vector of length n (must have the same length as x).

b

It can be a vector of length n (must have the same length as y).

Details

The Bregman scoring function (type 2) is defined by:

S(x, y, b) := \dfrac{1}{b (b - 1)} (y^b - x^b) - \dfrac{1}{b - 1} x^{b - 1} (y - x)

Domain of function:

x > 0

y > 0

b \in \R \setminus \lbrace 0, 1 \rbrace

Range of function:

S(x, y, b) \geq 0, \forall x, y > 0, b \in \R \setminus \lbrace 0, 1 \rbrace

Value

Vector of Bregman losses.

Note

The implemented function is denoted as type 2 since it corresponds to a specific type of \phi(x) of the general form of the Bregman scoring function defined by eq. (18) in Gneiting (2011).

For details on the Bregman scoring function, see Savage 1971, Banerjee et al. (2005) and Gneiting (2011). For details on the specific form implemented here, see Patton (2011).

The mean functional is the mean E_F[Y] of the probability distribution F of y (Gneiting 2011).

The Bregman scoring function is negatively oriented (i.e. the smaller, the better).

The herein implemented Bregman scoring function is strictly consistent for the mean functional relative to the family \mathbb{F} of potential probability distributions F for the future y for which E_F[Y] and E_F[\dfrac{1}{b (b - 1)} Y^b] exist and are finite (Savage 1971, Gneiting 2011).

References

Banerjee A, Guo X, Wang H (2005) On the optimality of conditional expectation as a Bregman predictor. IEEE Transactions on Information Theory 51(7):2664–2669. doi:10.1109/TIT.2005.850145.

Gneiting T (2011) Making and evaluating point forecasts. Journal of the American Statistical Association 106(494):746–762. doi:10.1198/jasa.2011.r10138.

Patton AJ (2011) Volatility forecast comparison using imperfect volatility proxies. Journal of Econometrics 160(1):246–256. doi:10.1016/j.jeconom.2010.03.034.

Savage LJ (1971) Elicitation of personal probabilities and expectations. Journal of the American Statistical Association 66(337):783–810. doi:10.1080/01621459.1971.10482346.

Examples

# Compute the Bregman scoring function (type 2).

df <- data.frame(
    y = rep(x = 2, times = 6),
    x = rep(x = 1:3, times = 2),
    b = rep(x = c(-3, 3), each = 3)
)

df$bregman2_penalty <- bregman2_sf(x = df$x, y = df$y, b = df$b)

print(df)

# The Bregman scoring function (type 2) is half the squared error scoring
# function, when b = 2.

df <- data.frame(
    y = rep(x = 5.5, times = 10),
    x = 1:10,
    b = rep(x = 2, times = 10)
)

df$bregman2_penalty <- bregman2_sf(x = df$x, y = df$y, b = df$b)

df$squared_error <- serr_sf(x = df$x, y = df$y)

df$ratio <- df$bregman2_penalty/df$squared_error

print(df)


# When a = b > 1 the Bregman scoring function (type 2) coincides with the
# Bregman scoring function (type 1) up to a multiplicative constant.

df <- data.frame(
    y = rep(x = 5.5, times = 10),
    x = 1:10,
    b = rep(x = c(3, 4), each = 5)
)

df$bregman2_penalty <- bregman2_sf(x = df$x, y = df$y, b = df$b)

df$bregman1_penalty <- bregman1_sf(x = df$x, y = df$y, a = df$b)

df$ratio <- df$bregman2_penalty/df$bregman1_penalty

print(df)

[Package scoringfunctions version 0.0.6 Index]