Re: [R] Convolution vector to be derived

From: Allan Engelhardt <allane_at_cybaea.com>
Date: Fri, 04 Jun 2010 21:09:52 +0100

On the contrary: it is trivial to produce the result.

x <- c(1,2,3,4,5)
y <- c(6,7,8,9)
convolve(x, rev(y), type="open")

# [1] 6 19 40 70 100 94 76 45

Try help("convolve").

Allan

On 04/06/10 19:21, Moohwan Kim wrote:
> Dear R-help,
>
> I want to generate the following outcome using the convolution of two sequences.
>
> x<- c(1,2,3,4,5)
> y<- c(6,7,8,9)
>
> The resulting convolution vector is
> 6
> 19
> 40
> 70
> 100
> 94
> 76
> 45
> When using convolve(), it is hard to produce the result above.
> Would you help me out to get that?
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 04 Jun 2010 - 20:12:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jun 2010 - 20:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive