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)numeric n-vector of weights in \([0, 1]\)
numeric n-vector of residuals from the current fit
robust scale estimate (e.g. MAD of residuals). If zero or very small, all weights are set to 1.
weight function: "huber" or "tukey",
Default: "huber"
tuning constant. If NULL, the default for
the chosen method is used.
Matthias Templ