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 |
deriv |
Numeric. If |
a |
Numeric. A scaling constant for |
b |
Numeric. A scaling constant for |
c |
Numeric. A scaling constant for 'psi.hampel |
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
-
psi.hampel
: The weight function of the hampel objective function. -
psi.bisquare
: The weight function of Tukey's bisquare objective function.
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)