Learn R Programming

VIM (version 7.3.0)

cellWeightsFromResiduals: Compute cell weights from regression residuals

Description

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.

Usage

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

Value

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

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.

Author

Matthias Templ