An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120625/d90f7f87/attachment.pl>
Help in rolling calculation
5 messages · Zachary Mayer, Raghuraman Ramachandran, Brian G. Peterson
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120625/81344eb1/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120625/7c87c462/attachment.pl>
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
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120625/8d2636b9/attachment.pl>