scipy.special.pseudo_huber

scipy.special.pseudo_huber(delta, r) = <ufunc 'pseudo_huber'>

Pseudo-Huber loss function.

\[\mathrm{pseudo\_huber}(\delta, r) = \delta^2 \left( \sqrt{ 1 + \left( \frac{r}{\delta} \right)^2 } - 1 \right)\]
Parameters
deltandarray

Input array, indicating the soft quadratic vs. linear loss changepoint.

rndarray

Input array, possibly representing residuals.

Returns
resndarray

The computed Pseudo-Huber loss function values.

Notes

This function is convex in \(r\).

New in version 0.15.0.