[Returnanalytics-commits] r3044 - pkg/PortfolioAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 10 19:02:44 CEST 2013


Author: rossbennett34
Date: 2013-09-10 19:02:44 +0200 (Tue, 10 Sep 2013)
New Revision: 3044

Modified:
   pkg/PortfolioAnalytics/R/optFUN.R
Log:
Modifying gmv_opt so that risk aversion parameter, lambda, is multiplied through the quadratic objective per Doug's feedback.

Modified: pkg/PortfolioAnalytics/R/optFUN.R
===================================================================
--- pkg/PortfolioAnalytics/R/optFUN.R	2013-09-10 16:49:13 UTC (rev 3043)
+++ pkg/PortfolioAnalytics/R/optFUN.R	2013-09-10 17:02:44 UTC (rev 3044)
@@ -62,7 +62,7 @@
   # set up the quadratic objective
   if(!is.null(lambda_hhi)){
     if(length(lambda_hhi) == 1 & is.null(conc_groups)){
-      ROI_objective <- Q_objective(Q=2*lambda*moments$var + lambda_hhi * diag(N), L=-moments$mean)
+      ROI_objective <- Q_objective(Q=2*lambda*(moments$var + lambda_hhi * diag(N)), L=-moments$mean)
     } else if(!is.null(conc_groups)){
       # construct the matrix with concentration aversion values by group
       hhi_mat <- matrix(0, nrow=N, ncol=N)
@@ -76,7 +76,7 @@
         }
         hhi_mat <- hhi_mat + lambda_hhi[i] * tmpI
       }
-      ROI_objective <- Q_objective(Q=2*lambda*moments$var + hhi_mat, L=-moments$mean)
+      ROI_objective <- Q_objective(Q=2*lambda*(moments$var + hhi_mat), L=-moments$mean)
     }
   } else {
     ROI_objective <- Q_objective(Q=2*lambda*moments$var, L=-moments$mean)



More information about the Returnanalytics-commits mailing list