Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. library(MASS)
  2.  
  3. opar = par()
  4. par(mfrow=c(1,2),cex.main=1)
  5.  
  6. xn=seq(-4,4,l=201)
  7. x=qnorm(ppoints(19,a=3/8))
  8. f=function(xc,x) mean(c(x,xc),trim=0.05)
  9. f2=function(xc,x) huber(c(x,xc),k=1.95)$mu
  10. infl=sapply(xn,f,x=x)
  11. plot(infl~xn,type="l",xlim=c(-4,4),col="blue3",main="Trimmed mean empirical IF")
  12. inflh=sapply(xn,f2,x=x)
  13. plot(inflh~xn,type="l",xlim=c(-4,4),col="blue3",,main="Huber empirical IF")
  14.  
  15. par(opar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement