[R] convolve bug?
yudi@ucd.ie
yudi at ucd.ie
Thu Nov 18 18:27:36 CET 1999
> I am still bugged by the 2nd problem: when I convolve a bump and a step I
> expect an ogive. Instead I get a bump. This seems to be due to a piecing
> together of the expected ogive with its time-reflected self.
>
You do get what you expect if you shorten the filter and take the piece
of the output that correspond to a full filtering (we lose half of
the fitler length on both sides.) The zero padding and the filter
length together create the unexpected behavior you mentioned.
x<-seq(1,500)
h<-dnorm(c(1:100), mean=50, sd=10)
y<-ifelse(x<=250, 0, 1)
plot(convolve(y,h, type="open")[101:500],type='l') #100= filter length
abline(v=250-50) # location of original step in the output
points(pnorm(c(1:400),mean=250-50,sd=10))
-Yudi-
------------------------------
Yudi Pawitan: yudi at stat.ucc.ie
Department of Statistics, UCC
Cork, Ireland
Ph : 353-21-902 906
Fax: 353-21-271 040
------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list