R/wt.carroll.q

Defines functions wt.carroll wt.huber

wt.carroll <- function(u, b) 
  (1.0 - (u/b)^2)^3 * (abs(u) <= b)


wt.huber <- function(u, const = 1.345)
{
  U <- abs(u)
  Ugtc <- U > const
  w <- u
  w[!Ugtc] <- 1.0
  w[Ugtc] <- const / U[Ugtc]
  w
}

Try the robust package in your browser

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

robust documentation built on May 2, 2019, 5:20 p.m.