computeRobustLoss: Compute Robust Loss (Internal)

View source: R/computeRobustLoss.R

computeRobustLossR Documentation

Compute Robust Loss (Internal)

Description

Scores validation residuals with the requested loss (mse, trimmed, or huber). Extracted from computeCVError so the same loss formulas can be reused by the outer cross-validation loop in cv.srlars.

Usage

computeRobustLoss(r_val, r_train, cv_loss)

Arguments

r_val

Numeric vector of validation residuals.

r_train

Numeric vector of training residuals, used only to set the scale for the Huber loss. Ignored for cv_loss = "mse" or "trimmed".

cv_loss

Character. Loss function: "huber", "trimmed", or "mse".

Value

Numeric. The scalar loss value.


srlars documentation built on Sept. 23, 2026, 5:10 p.m.