[Returnanalytics-commits] r1949 - pkg/PerformanceAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 19 12:54:09 CEST 2012


Author: braverock
Date: 2012-05-19 12:54:09 +0200 (Sat, 19 May 2012)
New Revision: 1949

Modified:
   pkg/PerformanceAnalytics/R/Drawdowns.R
Log:
- fix error in calculating drawdown with arithmetic returns.  thanks to Pat Burns for the patch

Modified: pkg/PerformanceAnalytics/R/Drawdowns.R
===================================================================
--- pkg/PerformanceAnalytics/R/Drawdowns.R	2012-05-19 10:06:51 UTC (rev 1948)
+++ pkg/PerformanceAnalytics/R/Drawdowns.R	2012-05-19 10:54:09 UTC (rev 1949)
@@ -17,7 +17,7 @@
         if(geometric)
             Return.cumulative = cumprod(1+x)
         else
-            Return.cumulative = 1+cumsum(x)
+            Return.cumulative = exp(cumsum(x))
         maxCumulativeReturn = cummax(c(1,Return.cumulative))[-1]
         column.drawdown = Return.cumulative/maxCumulativeReturn - 1
     }



More information about the Returnanalytics-commits mailing list