View source: R/powerweighted_if.R
| powerweighted_if | R Documentation |
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.
powerweighted_if(x, y, a)
x |
Predictive
|
y |
Realisation (true value) of process. It can be a vector of length
|
a |
It can be a vector of length |
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}
Vector of values of the power-weighted identification function.
The \dfrac{\textnormal{E}_F [Y^{a + 1}]}{\textnormal{E}_F [Y^a]}
functional is the ratio of expectations formed by weighting the probability
distribution F of Y with w(y) = y^a (eq. (11) in
Gneiting 2011). For details on this functional, see powerweighted_sf.
The power-weighted identification function is a strict
\mathbb{F}-identification function for the
\dfrac{\textnormal{E}_F [Y^{a + 1}]}{\textnormal{E}_F [Y^a]} functional
(Table 9 and Theorem 8 in Gneiting 2011). \mathbb{F} is the family of
probability distributions F for which \textnormal{E}_F[Y^a] and
\textnormal{E}_F[Y^{a + 1}] exist and are finite (Theorem 8 in
Gneiting 2011).
At a = 0 the power-weighted identification function reduces to
mean_if and the functional to the mean \textnormal{E}_F[Y].
This is the identification function counterpart of powerweighted_sf, and
thereby also of obsweighted_sf and srelerr_sf at a = 1 and
of sperr_sf at a = -2.
Gneiting T (2011) Making and evaluating point forecasts. Journal of the American Statistical Association 106(494):746–762. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/jasa.2011.r10138")}.
powerweighted_sf
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.