The R Project SVN R

Rev

Rev 60995 | Rev 70136 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60995 Rev 61168
Line 84... Line 84...
84
smooth(x3R, kind = "S")
84
smooth(x3R, kind = "S")
85
 
85
 
86
sm.3RS <- function(x, ...)
86
sm.3RS <- function(x, ...)
87
   smooth(smooth(x, "3R", ...), "S", ...)
87
   smooth(smooth(x, "3R", ...), "S", ...)
88
 
88
 
89
y <- c(1,1, 19:1)
89
y <- c(1, 1, 19:1)
90
plot(y, main = "misbehaviour of \"3RSR\"", col.main = 3)
90
plot(y, main = "misbehaviour of \"3RSR\"", col.main = 3)
91
lines(sm.3RS(y))
91
lines(sm.3RS(y))
92
lines(smooth(y))
92
lines(smooth(y))
93
lines(smooth(y, "3RSR"), col = 3, lwd = 2)# the horror
93
lines(smooth(y, "3RSR"), col = 3, lwd = 2)  # the horror
94
 
94
 
95
x <- c(8:10,10, 0,0, 9,9)
95
x <- c(8:10, 10, 0, 0, 9, 9)
96
plot(x, main = "breakdown of  3R  and  S  and hence  3RSS")
96
plot(x, main = "breakdown of  3R  and  S  and hence  3RSS")
97
matlines(cbind(smooth(x,"3R"),smooth(x,"S"), smooth(x,"3RSS"),smooth(x)))
97
matlines(cbind(smooth(x, "3R"), smooth(x, "S"), smooth(x, "3RSS"), smooth(x)))
98
 
98
 
99
presidents[is.na(presidents)] <- 0 # silly
99
presidents[is.na(presidents)] <- 0 # silly
100
summary(sm3 <- smooth(presidents, "3R"))
100
summary(sm3 <- smooth(presidents, "3R"))
101
summary(sm2 <- smooth(presidents,"3RSS"))
101
summary(sm2 <- smooth(presidents,"3RSS"))
102
summary(sm  <- smooth(presidents))
102
summary(sm  <- smooth(presidents))
103
 
103
 
104
all.equal(c(sm2),c(smooth(smooth(sm3, "S"), "S"))) # 3RSS  === 3R S S
104
all.equal(c(sm2), c(smooth(smooth(sm3, "S"), "S")))  # 3RSS  === 3R S S
105
all.equal(c(sm), c(smooth(smooth(sm3, "S"), "3R")))# 3RS3R === 3R S 3R
105
all.equal(c(sm),  c(smooth(smooth(sm3, "S"), "3R"))) # 3RS3R === 3R S 3R
106
 
106
 
107
plot(presidents, main = "smooth(presidents0, *) :  3R and default 3RS3R")
107
plot(presidents, main = "smooth(presidents0, *) :  3R and default 3RS3R")
108
lines(sm3,col = 3, lwd = 1.5)
108
lines(sm3, col = 3, lwd = 1.5)
109
lines(sm, col = 2, lwd = 1.25)
109
lines(sm, col = 2, lwd = 1.25)
110
}
110
}
111
\keyword{robust}
111
\keyword{robust}
112
\keyword{smooth}
112
\keyword{smooth}