Given a vector of residuals and a robust scale estimate, standardize and apply a robust weight function. This is used inside the IRWLS loop to compute psi-weights from the current fit residuals.

cellWeightsFromResiduals(residuals, sigma, method = "huber", alpha = NULL)

Arguments

residuals

numeric n-vector of residuals from the current fit

sigma

robust scale estimate (e.g. MAD of residuals). If zero or very small, all weights are set to 1.

method

weight function: "huber" or "tukey", Default: "huber"

alpha

tuning constant. If NULL, the default for the chosen method is used.

Value

numeric n-vector of weights in \([0, 1]\)

Author

Matthias Templ