[R] (no subject)

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jul 1 13:40:56 CEST 2009


On Wed, Jul 1, 2009 at 6:22 AM, Andriy Fetsun<fetsun at googlemail.com> wrote:
> Hi,
>
> 1.) I am trying to calculate the autocorrelation function for returns based
> on rolling window, but it doesn't work.
>
> My code is
>
> rollapply(Returns,20,acf).

That's because acf returns a list.  Try this:

rollapply(z, 20, function(x) acf(x)$acf)




More information about the R-help mailing list