Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tukeyPsi1

Tukey's Bi-square Score (Psi) and "Chi" (Rho) Functions and Derivatives


Description

These are deprecated, replaced by Mchi(*, psi="tukey"), Mpsi(*, psi="tukey")

tukeyPsi1() computes Tukey's bi-square score (psi) function, its first derivative or it's integral/“principal function”. This is scaled such that ψ'(0) = 1, i.e., psi(x) ~= x around 0.

tukeyChi() 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-functions.

Usage

tukeyPsi1(x, cc, deriv = 0)
tukeyChi (x, cc, deriv = 0)

Arguments

x

numeric vector.

cc

tuning constant

deriv

integer in \{-1,0,1,2\} specifying the order of the derivative; the default, deriv = 0 computes the psi-, or chi- ("rho"-)function.

Value

a numeric vector of the same length as x.

Note

tukeyPsi1(x, d) and tukeyChi(x, d+1) are just re-scaled versions of each other (for d in -1:1), i.e.,

χ^{(ν)}(x, c) = (6/c^2) ψ^{(ν-1)}(x,c),

for ν = 0,1,2.

We use the name ‘tukeyPsi1’, because tukeyPsi is reserved for a future “Psi Function” class object, see psiFunc.

Author(s)

Matias Salibian-Barrera, Martin Maechler and Andreas Ruckstuhl

See Also

lmrob and Mpsi; further anova.lmrob which needs the deriv = -1.

Examples

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)

op <- par(mfrow = c(3,1), oma = c(0,0, 2, 0),
          mgp = c(1.5, 0.6, 0), mar= .1+c(3,4,1,1))
x <- seq(-5, 5, length = 201)
cc <- 4.69 # as set by default in lmrob.control()
plot. <- function(...) { plot(..., asp = 1); abline(h=0,v=0, col="gray", lty=3)}
plot.(x, tukeyPsi1(x, cc), type = "l", col = 2)
abline(0:1, lty = 3, col = "light blue")
plot.(x, tukeyPsi1(x, cc, deriv = -1), type = "l", col = 2)
plot.(x, tukeyPsi1(x, cc, deriv =  1), type = "l", col = 2); abline(h=1,lty=3)

mtext(sprintf("tukeyPsi1(x, c = %g, deriv),  deriv = 0, -1, 1", cc),
      outer = TRUE, font = par("font.main"), cex = par("cex.main"))
par(op)

robustbase

Basic Robust Statistics

v0.93-7
GPL (>= 2)
Authors
Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Peter Rousseeuw [ctb] (Qn and Sn), Christophe Croux [ctb] (Qn and Sn), Valentin Todorov [aut] (most robust Cov), Andreas Ruckstuhl [aut] (nlrob, anova, glmrob), Matias Salibian-Barrera [aut] (lmrob orig.), Tobias Verbeke [ctb, fnd] (mc, adjbox), Manuel Koller [aut] (mc, lmrob, psi-func.), Eduardo L. T. Conceicao [aut] (MM-, tau-, CM-, and MTL- nlrob), Maria Anna di Palma [ctb] (initial version of Comedian)
Initial release
2021-01-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.