[Returnanalytics-commits] r3040 - pkg/PerformanceAnalytics/sandbox/pulkit/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 10 02:56:38 CEST 2013


Author: pulkit
Date: 2013-09-10 02:56:37 +0200 (Tue, 10 Sep 2013)
New Revision: 3040

Modified:
   pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R
Log:
Annualized SR in Benchmark SR

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-09-09 22:33:05 UTC (rev 3039)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-09-10 00:56:37 UTC (rev 3040)
@@ -72,7 +72,7 @@
   if(!is.null(R)){
     x = checkData(R)
     columns = ncol(x)
-    avgSR = mean(SharpeRatio(R,FUN="StdDev"))
+    avgSR = mean(SharpeRatio.annualized(R))
   }
   else{
     if(is.null(avgSR) | is.null(S)){

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R	2013-09-09 22:33:05 UTC (rev 3039)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R	2013-09-10 00:56:37 UTC (rev 3040)
@@ -2,7 +2,7 @@
 #'Benchmark Sharpe Ratio
 #'
 #'@description
-#'The benchmark SR is a linear function of the average
+#'The benchmark SR is a linear function of the average annualized
 #' SR of the individual strategies, and a decreasing
 #' convex function of the number of strategies and the 
 #' average pairwise correlation. The Returns are given as
@@ -10,8 +10,9 @@
 #' 
 #'\deqn{SR_B = \bar{SR}\sqrt{\frac{S}{1+(S-1)\bar{\rho}}}}
 #'
-#'Here \eqn{\bar{SR}} is the average SR of the portfolio and \eqn{\bar{\rho}} 
-#'is the average correlation across off-diagonal elements
+#'Here \eqn{\bar{SR}} is the average annualized Sharpe Ratio of the portfolio and \eqn{\bar{\rho}} 
+#'is the average correlation across off-diagonal elements.
+#' 
 #'
 #'@param R a vector, matrix, data frame,timeseries or zoo object of asset returns
 #'
@@ -46,7 +47,7 @@
   if(columns == 1){
     stop("The number of return series should be greater than 1")
   }
-  SR = SharpeRatio(x,FUN="StdDev")
+  SR = SharpeRatio.annualized(x)
   sr_avg = mean(SR)
   corr = table.Correlation(R,R)
   corr_avg = 0

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R	2013-09-09 22:33:05 UTC (rev 3039)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R	2013-09-10 00:56:37 UTC (rev 3040)
@@ -75,7 +75,7 @@
   if(columns == 1){  
     stop("The number of return series should be greater 1 ")
   }
-  SR = SharpeRatio(x,FUN="StdDev")
+  SR = SharpeRatio.annualized(x)
   sr_avg = mean(SR)
   corr = table.Correlation(R,R)
   corr_avg = 0



More information about the Returnanalytics-commits mailing list