qrnn (version 2.0.5)

huber: Huber norm and Huber approximations to the ramp and tilted absolute value functions

Description

Huber norm function providing a hybrid L1/L2 norm. Huber approximations to the ramp hramp and tilted absolute value tilted.approx functions. huber.prime, hramp.prime, and tilted.approx.prime provide the corresponding derivatives.

Usage

huber(x, eps)
huber.prime(x, eps)
hramp(x, lower, eps)
hramp.prime(x, lower, eps)
tilted.approx(x, tau, eps)
tilted.approx.prime(x, tau, eps)

Arguments

x

numeric vector.

eps

epsilon value used in huber and related functions.

tau

desired tau-quantile.

lower

left censoring point.

See Also

tilted.abs, qrnn.cost

Examples

Run this code
x <- seq(-10, 10, length=100)
plot(x, huber(x, eps=1), type="l", col="black", ylim=c(-2, 10), ylab="")
lines(x, hramp(x, lower=0, eps=1), col="red")
lines(x, tilted.approx(x, tau=0.1, eps=1), col="blue")
lines(x, huber.prime(x, eps=1), col="black", lty=2)
lines(x, hramp.prime(x, lower=0, eps=1), lty=2, col="red")
lines(x, tilted.approx.prime(x, tau=0.1, eps=1), lty=2, col="blue")

Run the code above in your browser using DataLab