Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(MASS)
- opar = par()
- par(mfrow=c(1,2),cex.main=1)
- xn=seq(-4,4,l=201)
- x=qnorm(ppoints(19,a=3/8))
- f=function(xc,x) mean(c(x,xc),trim=0.05)
- f2=function(xc,x) huber(c(x,xc),k=1.95)$mu
- infl=sapply(xn,f,x=x)
- plot(infl~xn,type="l",xlim=c(-4,4),col="blue3",main="Trimmed mean empirical IF")
- inflh=sapply(xn,f2,x=x)
- plot(inflh~xn,type="l",xlim=c(-4,4),col="blue3",,main="Huber empirical IF")
- par(opar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement