[R-SIG-Finance] PerformanceAnalytics issue

Peter Carl peter at braverock.com
Wed Jul 25 17:45:30 CEST 2012


Look at your returns.csv file - all your monthly returns are rounded to
the nearest 1%, so the graph is not going to be anywhere close to your
expectations.

Your issue with method = "simple" has been reported before to this list
and was corrected in r-forge.  Check that you are using the most
up-to-date CRAN release, and if not then try updating.

pcc
-- 
Peter Carl
http://www.braverock.com/peter

> 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.
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



More information about the R-SIG-Finance mailing list