[R-SIG-Finance] PerformanceAnalytics issue

Julien Dargent jdargent at dci.com
Wed Jul 25 05:52:09 CEST 2012


Dear all:

I am facing a disconcerting issue with the functions CalculateReturns() and chart.CumReturns() of the PerformanceAnalytics package.

First, when I try to use CalculateReturns() to back out the returns from the total return indices values, the resulting returns do not add up:

Indices.ts <- as.timeSeries(CalculateReturns(indices, method = "compound"))
#Note that the method = "simple" option only returns zeros for me.

Running the code above on the data in the "indices" CSV file attached, I obtain suspicious returns (for instance the total return for S&P 500 is 17% while it is actually close to 40%).

Second, when I do the reverse and use chart.CumReturns() with the correct returns calculated manually in the "returns" CSV file attached, I also obtain wrong cumulative returns.

Returns.ts <-      chart.CumReturns(returns[,c(1:5), drop = FALSE],
                                                main="Cumulative Returns",
                                                begin="axis",
                                                 legend.loc = "topleft",
                                                 geometric = TRUE,
                                                 wealth.index = TRUE,
                                                colorset = rainbow6equal)

Running this code plots for instance the Barclays US Agg Corporate in my sample above the Barclays Global Agg whereas the later outperformed it.

[cid:image001.png at 01CD69DE.3138E1C0]

I spent a fair amount of time trying to resolve this by myself but it appears that something is amiss.

Thanks in advance for your much appreciated help!

Julien



This e-mail and its attachments are intended only for the individual or entity to whom it is addressed and may contain information that is confidential, privileged, inside information, or subject to other restrictions on use or disclosure. If you have received this transmission in error, please notify the sender immediately by return e-mail, and permanently delete or destroy this e-mail, any attachments, and all copies. Any unauthorized use, dissemination or copying of this transmission or the information may be unlawful. This message is provided for informational purposes and should not be construed as an invitation or offer to buy or sell any securities or related financial instruments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120725/c06eb416/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 21224 bytes
Desc: image001.png
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120725/c06eb416/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Indices.csv
Type: application/octet-stream
Size: 84398 bytes
Desc: Indices.csv
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120725/c06eb416/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: returns.csv
Type: application/octet-stream
Size: 47109 bytes
Desc: returns.csv
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120725/c06eb416/attachment-0001.obj>


More information about the R-SIG-Finance mailing list