R/huber.mu.R

Defines functions huber.mu

Documented in huber.mu

huber.mu<-function(x,c=1.28,iter=20,conv=.1e-06){
mu.hat <- huber.NR(x, c, iter)
if(c < 0) stop("c must be >= 0")
if(c == 0 | is.nan(mu.hat[2])) mu.est <- median(x)
if(c > 0 & !is.nan(mu.hat[2]))
for(i in 1:iter){
if(abs(mu.hat[i] - mu.hat[i+1]) <=conv) mu.est=mu.hat[i+1]
}
mu.est
}

Try the asbio package in your browser

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

asbio documentation built on Aug. 20, 2023, 9:07 a.m.