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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 12 04:50:38 CEST 2012


Author: hezkyvaron
Date: 2012-06-12 04:50:37 +0200 (Tue, 12 Jun 2012)
New Revision: 2006

Modified:
   pkg/PortfolioAnalytics/R/optimize.portfolio.R
Log:
Added skeleton ROI solver if-block within optimize.portfolio()

Modified: pkg/PortfolioAnalytics/R/optimize.portfolio.R
===================================================================
--- pkg/PortfolioAnalytics/R/optimize.portfolio.R	2012-06-11 18:55:48 UTC (rev 2005)
+++ pkg/PortfolioAnalytics/R/optimize.portfolio.R	2012-06-12 02:50:37 UTC (rev 2006)
@@ -229,6 +229,18 @@
       out$objective_measures<-try(constrained_objective(w=min_objective_weights,R=R,constraints,trace=TRUE)$objective_measures)
       out$call<-call
       #' construct out list to be as similar as possible to DEoptim list, within reason
+
+  } ## end case for random
+  
+  if(optimize_method == "ROI"){
+    # This will take a new constraint object that is of the same structure of a 
+    # ROI constraint object, but with an additional solver arg.
+    # then we can do something like this
+    #
+    # roi.result <- ROI_solve(x=ROI_constraint$constraint, ROI_constraint$solver)
+    # out$weights <- roi.result$solution
+    # out$objective_measures <- roi.result$objval
+    
   }
     end_t<-Sys.time()
     # print(c("elapsed time:",round(end_t-start_t,2),":diff:",round(diff,2), ":stats: ", round(out$stats,4), ":targets:",out$targets))



More information about the Returnanalytics-commits mailing list