Learn R Programming

scoringfunctions (version 1.2)

powerweighted_if: Power-weighted identification function

Description

The function powerweighted_if computes the power-weighted identification function with parameter \(a\), when \(y\) materialises and \(\dfrac{\textnormal{E}_F [Y^{a + 1}]}{\textnormal{E}_F [Y^a]}\) is the predictive functional.

The power-weighted identification function is defined by Table 9 in Gneiting (2011), applied to \(r(y) = y^{a + 1}\) and \(s(y) = y^a\).

Usage

powerweighted_if(x, y, a)

Value

Vector of values of the power-weighted identification function.

Arguments

x

Predictive \(\dfrac{\textnormal{E}_F [Y^{a + 1}]}{\textnormal{E}_F [Y^a]}\) functional (prediction). It can be a vector of length \(n\) (must have the same length as \(y\)).

y

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

a

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

Details

The power-weighted identification function is defined by:

$$V(x, y, a) := x y^a - y^{a + 1}$$

or equivalently,

$$V(x, y, a) := y^a (x - y)$$

Domain of function:

$$x > 0$$

$$y > 0$$

$$a \in \mathbb{R}$$

Range of function:

$$V(x, y, a) \in \mathbb{R}$$

References

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

See Also

powerweighted_sf

Examples

Run this code
# Compute the power-weighted identification function.

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

df$powerweighted_if <- powerweighted_if(x = df$x, y = df$y, a = df$a)

print(df)

# The power-weighted identification function reduces to the mean identification
# function at a = 0.

set.seed(12345)

n <- 10

x <- runif(n = n, min = 0, max = 2)
y <- runif(n = n, min = 0, max = 2)

max(abs(powerweighted_if(x = x, y = y, a = 0) - mean_if(x = x, y = y)))

# values are slightly higher than 0 due to rounding error

Run the code above in your browser using DataLab