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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 12 05:15:58 CEST 2013


Author: rossbennett34
Date: 2013-07-12 05:15:58 +0200 (Fri, 12 Jul 2013)
New Revision: 2555

Modified:
   pkg/PortfolioAnalytics/R/constrained_objective.R
Log:
fixed paren error in constrained_objective

Modified: pkg/PortfolioAnalytics/R/constrained_objective.R
===================================================================
--- pkg/PortfolioAnalytics/R/constrained_objective.R	2013-07-12 03:12:18 UTC (rev 2554)
+++ pkg/PortfolioAnalytics/R/constrained_objective.R	2013-07-12 03:15:58 UTC (rev 2555)
@@ -422,7 +422,7 @@
   # may be replaced by fn_map later
   if(isTRUE(normalize)){
       w <- fn_map(weights=w, portfolio=portfolio)$weights
-    } # end fn_map transformation
+      # end fn_map transformation
   } else {
     # the user wants the optimization algorithm to figure it out
     if(!is.null(constraints$max_sum) & constraints$max_sum != Inf ) {
@@ -445,11 +445,11 @@
     out <- out + sum(constraints$min[which(w < min[1:N])] - w[which(w < min[1:N])]) * penalty
   }
 
-# TODO
-# penalize weights that violate group constraints
-# penalize weights that violate max_pos constraints
-# penalize weights that violate diversification constraint
-# penalize weights that violate turnover constraint
+  # TODO
+  # penalize weights that violate group constraints
+  # penalize weights that violate max_pos constraints
+  # penalize weights that violate diversification constraint
+  # penalize weights that violate turnover constraint
   
   nargs <- list(...)
   if(length(nargs)==0) nargs <- NULL



More information about the Returnanalytics-commits mailing list