Huber {extraDistr}R Documentation

"Huber density" distribution

Description

Density, distribution function, quantile function and random generation for the "Huber density" distribution.

Usage

dhuber(x, mu = 0, sigma = 1, epsilon = 1.345, log = FALSE)

phuber(q, mu = 0, sigma = 1, epsilon = 1.345, lower.tail = TRUE,
  log.p = FALSE)

qhuber(p, mu = 0, sigma = 1, epsilon = 1.345, lower.tail = TRUE,
  log.p = FALSE)

rhuber(n, mu = 0, sigma = 1, epsilon = 1.345)

Arguments

x, q

vector of quantiles.

mu, sigma, epsilon

location, and scale, and shape parameters. Scale and shape must be positive.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[X ≤ x] otherwise, P[X > x].

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Huber density is connected to Huber loss and can be defined as:

f(x) = 1/(2 * sqrt(2π) * (Φ(k) + φ(k)/k - 1/2)) * exp(-ρ(x, k))

where

ρ(x, k) = [if abs(x) <= k:] (x^2)/2 [else:] k*abs(x) - (k^2)/2

References

Huber, P.J. (1964). Robust Estimation of a Location Parameter. Annals of Statistics, 53(1), 73-101.

Huber, P.J. (1981). Robust Statistics. Wiley.

Schumann, D. (2009). Robust Variable Selection. ProQuest.

Examples


x <- rhuber(1e5, 5, 2, 3)
hist(x, 100, freq = FALSE)
curve(dhuber(x, 5, 2, 3), -20, 20, col = "red", add = TRUE, n = 5000)
hist(phuber(x, 5, 2, 3))
plot(ecdf(x))
curve(phuber(x, 5, 2, 3), -20, 20, col = "red", lwd = 2, add = TRUE)


[Package extraDistr version 1.8.11 Index]