[R-SIG-Finance] Help in rolling calculation
Brian G. Peterson
brian at braverock.com
Mon Jun 25 22:28:49 CEST 2012
On Mon, 2012-06-25 at 21:13 +0100, Raghuraman Ramachandran wrote:
> Do you think there exists any other elegant solution?
>
It doesn't get much simpler or more 'elegant' than that.
This is of course too simple to handle nuanced transaction ordering,
commissions, etc.
> Also do you think rollapply or apply.fromstart etc could also be used
> to solve such problems?
>
Yes, but cumprod is written in C underneath,so it's faster to use it if
you can.
>
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list