[R] convolution question

Christoph Lehmann christoph.lehmann at gmx.ch
Mon Oct 6 16:37:24 CEST 2003


Dear R-users
I have a question about convolution, using the convolve() command:

the following code gives a function, which will be convolved with a
train of delta functions. Can anybody tell me, why the convolved
function doesn't have the same length as the original train of delta
functions?

tau <- 1.25
N <- 3
t <- seq(0,15,by=3)
h <- (t/tau)^(N-1)*exp(-t/tau)/(tau*prod(N-1))
plot(h,type='o') 
stick <- rep(0,100)
ones <- round(runif(66)*99)+1
stick[ones] <-1
stick

X11() #open another graphics device
plot(stick)

convolution <- convolve(stick,h,conj=FALSE,type='filter')
X11() #open another graphics device
plot(convolution,type='o')




many thanks!
-- 
Christoph Lehmann <christoph.lehmann at gmx.ch>




More information about the R-help mailing list