I want to calculate/evaluate the convolution
$$g(x)=\int_D f(x-t) \phi(t) dt,$$
where $f$ is a density and $\phi$ is a smooth function with compact support $D$. The convolution is not available in closed-form and I need to integrate it numerically. My question is: Is there an efficient way to do this? I want to implement it in R, so, I would like to see if there is a better way than using the command integrate().
?fft) or useconvolve. The fft approach takes a bit more work to set up but is better if you need to convolve with something several times. Sometimes it takes a while to figure out the right argument settings with convolve. – Glen_b Nov 05 '14 at 13:52convolvefor this purpose several times. Simple working examples appear at http://stats.stackexchange.com/a/41263, http://stats.stackexchange.com/a/41255, and http://stats.stackexchange.com/a/49444. – whuber Nov 05 '14 at 15:47