Huber {qrmix} | R Documentation |
Huber Loss
Description
Evaluates the Huber loss function defined as
f(r) = \left\{
\begin{array}{ll}
\frac{1}{2}|r|^2 & |r| \le c \\
c(|r|-\frac{1}{2}c) & |r| > c
\end{array}
\right.
Usage
Huber(r, c = 1.345)
Arguments
r |
a real number or vector. |
c |
a positive number. If the value is negative, it's absolute value will be used. |
Examples
set.seed(1)
x = rnorm(200, mean = 1)
y = Huber(x)
plot(x, y)
abline(h = (1.345)^2/2)
[Package qrmix version 0.9.0 Index]