Re: [R] apply.rolling() to a multi column timeSeries

2011-03-04 Thread Gabor Grothendieck
On Fri, Mar 4, 2011 at 10:47 AM, William Mok wrote: > Hello there, > > > I am trying to compute the 3 months return momentum with the timeSeries x.ts, > which is just a subset of simple returns from a much bigger series, > >> class(x.ts) > [1] "timeSeries" > attr(,"package") > [1] "timeSeries" > >

Re: [R] apply.rolling() to a multi column timeSeries

2011-03-04 Thread Joshua Wiley
Hi Will, Time series are not my strength, but it seems like this is a case where it is easiest to use rollapply() directly rather than the wrapper in PerformanceAnalytics. Here is an example using one of the provided datasets. The first element of the output list is created using regular apply()

[R] apply.rolling() to a multi column timeSeries

2011-03-04 Thread William Mok
Hello there, I am trying to compute the 3 months return momentum with the timeSeries x.ts, which is just a subset of simple returns from a much bigger series, > class(x.ts) [1] "timeSeries" attr(,"package") [1] "timeSeries" > dim(x.ts) [1] 20 3 > x.ts[1:8,] GMT MS.US AA