cellWeightsFromResiduals: Compute cell weights from regression residuals

View source: R/cellwise_utils.R

cellWeightsFromResidualsR Documentation

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)

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(s)

Matthias Templ


VIM documentation built on Sept. 2, 2026, 5:07 p.m.