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

weight.funs

Weight Functions Psi, Rho, Chi


Description

These functions compute the weights used by lmRob and its associated methods.

Usage

psi.weight(x, ips = 1, xk = 1.06)
rho.weight(x, ips = 1, xk = 1.06)
psp.weight(x, ips = 1, xk = 1.06)
chi.weight(x, ips = 1, xk = 1.06)

Arguments

x

a numeric vector.

ips

integer determining the weight function:

ips = 1

"optimal"

,

ips = 2

rescaled bisquare

,

ips = 3

Huber

,

ips = 4

smoothed Huber

, which is currently only available for psi.*() and its derivative psp.*().

xk

a numeric value specifying the tuning constant.

Details

See the section “Theoretical Details”, p. 58-59, in chapter 2 of ‘Robust.pdf’.

Value

a numeric vector, say r of the same length as x, containing the function values r[i] = f(x[i]).

Examples

x <- seq(-4,4, length=401)
f.x <- cbind(psi = psi.weight(x), psp = psp.weight(x),
             chi = chi.weight(x), rho = rho.weight(x))
es <- expression(psi(x), {psi*minute}(x), chi(x), rho(x))
leg <- as.expression(lapply(seq_along(es), function(i)
          substitute(C == E, list(C=colnames(f.x)[i], E=es[[i]]))))
matplot(x, f.x, type = "l", lwd = 1.5,
        main = "psi.weight(.) etc -- 'optimal'")
abline(h = 0, v = 0, lwd = 2, col = "#D3D3D380") # opaque gray
legend("bottom", leg, inset = .01,
       lty = 1:4, col = 1:4, lwd = 1.5, bg = "#FFFFFFC0")

robust

Port of the S+ "Robust Library"

v0.5-0.0
GPL-2
Authors
Jiahui Wang, Ruben Zamar <ruben@stat.ubc.ca>, Alfio Marazzi <Alfio.Marazzi@inst.hospvd.ch>, Victor Yohai <vyohai@dm.uba.ar>, Matias Salibian-Barrera <matias@stat.ubc.ca>, Ricardo Maronna <maron@mate.unlp.edu.ar>, Eric Zivot <ezivot@u.washington.edu>, David Rocke <dmrocke@ucdavis.edu>, Doug Martin, Martin Maechler <maechler@stat.math.ethz.ch>, Kjell Konis <kjell.konis@me.com>.
Initial release
2020-03-07

We don't support your browser anymore

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