R/ghuber_sf.R

Defines functions ghuber_sf

Documented in ghuber_sf

ghuber_sf <- function(x, y, p, a, b)
{
    f <- function(t, a, b)
    {
        capping_function(t, a, b) * (2 * t - capping_function(t, a, b))
    }

    err <- x - y

    p * f(pmin(err, 0), a, b) + (1 - p) * f(pmax(err, 0), a, b)
}

Try the scoringfunctions package in your browser

Any scripts or data that you put into this service are public.

scoringfunctions documentation built on April 4, 2025, 12:28 a.m.