psi.huber {complexlm}R Documentation

Weighting functions for robust fitting

Description

Weighting functions used in rlm for iteratively reweighted least squares. Based on the same functions from MASS, modified to accept complex variables. While named 'psi', these are actually weight functions, weight(u) = abs( influence(u) / u).

Usage

psi.huber(u, k = 1.345, deriv = 0)

psi.hampel(u, a = 2, b = 4, c = 8, deriv = 0)

psi.bisquare(u, c = 4.685, deriv = 0)

Arguments

u

Numeric or complex. When used in M-estimation, a residual.

k

Numeric. A scaling constant for psi.huber. Default value is 1.345

deriv

Numeric. If 0, return the weight at u. If 1 return the first derivative of the influence function at u.

a

Numeric. A scaling constant for psi.hampel. Default value is 2

b

Numeric. A scaling constant for psi.hampel. Default value is 4

c

Numeric. A scaling constant for 'psi.hampelorpsi.bisquare'. Default is 8 for the former and 4.685 for the later.

Details

Three weight functions for iteratively (re)weighted least squares. When used in M-estimation, psi.huber has a unique solution. psi.hampel and psi.bisquare, which are redescending M-estimators, do not have a unique solution. These are capable of completely rejecting outliers, but need a good starting point to avoid falling into unhelpful local minima. If deriv is set to 1, the functions return the value of the first derivative of the influence function at u. Note that they do not return the derivative of the weight function, as might be expected.

Value

A numeric or complex that is either the value of the weight function at u (numeric) or the first derivative of the influence function at u (can be complex).

Functions

Examples

set.seed(4242)
z <- complex(real = rnorm(3), imaginary = rnorm(3))
psi.huber(z)
psi.hampel(z)
psi.bisquare(z)
psi.huber(z, deriv=1)
psi.hampel(z, deriv=1)

[Package complexlm version 1.1.2 Index]