Learn R Programming

robustbase (version 0.5-0-1)

tukeyChi: Tukey's "Chi", the Bi-square Loss (Rho) Function

Description

Computes Tukey's bi-square loss function, chi(x) and its first two derivatives. Note that in the general context of $M$-estimators, these loss functions are called $\rho (rho)$-functions.

Usage

tukeyChi(x, cc, deriv = 0)

Arguments

x
numeric vector.
cc
tuning constant
deriv
integer in ${0,1,2}$ specifying the order of the derivative; the default, deriv = 0 computes the chi- (or rho-)function.

Value

  • a numeric vector of the same length as x.

See Also

lmrob and tukeyPsi1.

Examples

Run this code
op <- par(mfrow = c(3,1), oma = c(0,0, 2, 0),
          mgp = c(1.5, 0.6, 0), mar= .1+c(3,4,3,2))
x <- seq(-2.5, 2.5, length = 201)
cc <- 1.55 # as set by default in lmrob.control()
plot. <- function(...) { plot(...); abline(h=0,v=0, col="gray", lty=3)}
plot.(x, tukeyChi(x, cc), type = "l", col = 2)
plot.(x, tukeyChi(x, cc, deriv = 1), type = "l", col = 2)
plot.(x, tukeyChi(x, cc, deriv = 2), type = "l", col = 2)mtext(sprintf("tukeyChi(x, c = %g, deriv),  deriv = 0,1,2", cc),
      outer = TRUE, font = par("font.main"), cex = par("cex.main"))
par(op)

Run the code above in your browser using DataLab