This function evaluates the first derivative of Huber's loss function.

psi.huber(r, k = 1.345)

Arguments

r

a vector of real numbers

k

a positive tuning constant.

Value

A vector of the same length as x.

Details

This function evaluates the first derivative of Huber's loss function.

Author

Matias Salibian-Barrera, matias@stat.ubc.ca, Alejandra Martinez

Examples

x <- seq(-2, 2, length=10) psi.huber(r=x, k = 1.5)
#> [1] -1.5000000 -1.5000000 -1.1111111 -0.6666667 -0.2222222 0.2222222 #> [7] 0.6666667 1.1111111 1.5000000 1.5000000