expectile_sf | R Documentation |
The function expectile_sf computes the asymmetric piecewise quadratic scoring
function (expectile scoring function) at a specific level p
, when
y
materialises and x
is the predictive expectile at level
p
.
The asymmetric piecewise quadratic scoring function is defined by eq. (27) in Gneiting (2011).
expectile_sf(x, y, p)
x |
Predictive expectile (prediction) at level |
y |
Realisation (true value) of process. It can be a vector of length
|
p |
It can be a vector of length |
The asymmetric piecewise quadratic scoring function is defined by:
S(x, y, p) := |\textbf{1} \lbrace x \geq y \rbrace - p| (x - y)^2
or equivalently,
S(x, y, p) := p (\max \lbrace -(x - y), 0 \rbrace)^2 +
(1 - p) (\max \lbrace x - y, 0 \rbrace)^2
Domain of function:
x \in \mathbb{R}
y \in \mathbb{R}
0 < p < 1
Range of function:
S(x, y, p) \geq 0, \forall x, y \in \mathbb{R}, p \in (0, 1)
Vector of expectile losses.
For the definition of expectiles, see Newey and Powell (1987).
The asymmetric piecewise quadratic scoring function is negatively oriented (i.e. the smaller, the better).
The asymmetric piecewise quadratic scoring function is strictly
\mathbb{F}
-consistent for the p
-expectile functional.
\mathbb{F}
is the family of probability distributions F
for which
\textnormal{E}_F[Y^2]
exists and is finite (Gneiting 2011).
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")}.
Newey WK, Powell JL (1987) Asymmetric least squares estimation and testing. Econometrica 55(4):819–847. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/1911031")}.
# Compute the asymmetric piecewise quadratic scoring function (expectile scoring
# function).
df <- data.frame(
y = rep(x = 0, times = 6),
x = c(2, 2, -2, -2, 0, 0),
p = rep(x = c(0.05, 0.95), times = 3)
)
df$expectile_penalty <- expectile_sf(x = df$x, y = df$y, p = df$p)
print(df)
# The asymmetric piecewise quadratic scoring function (expectile scoring
# function) at level p = 0.5 is half the squared error scoring function.
df <- data.frame(
y = rep(x = 0, times = 3),
x = c(-2, 0, 2),
p = rep(x = c(0.5), times = 3)
)
df$expectile_penalty <- expectile_sf(x = df$x, y = df$y, p = df$p)
df$squared_error <- serr_sf(x = df$x, y = df$y)
print(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.