[Returnanalytics-commits] r3375 - in pkg/PortfolioAnalytics: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 20 18:38:03 CEST 2014


Author: rossbennett34
Date: 2014-04-20 18:38:03 +0200 (Sun, 20 Apr 2014)
New Revision: 3375

Modified:
   pkg/PortfolioAnalytics/DESCRIPTION
   pkg/PortfolioAnalytics/R/optFUN.R
   pkg/PortfolioAnalytics/R/optimize.portfolio.R
   pkg/PortfolioAnalytics/man/etl_milp_opt.Rd
   pkg/PortfolioAnalytics/man/etl_opt.Rd
   pkg/PortfolioAnalytics/man/gmv_opt.Rd
   pkg/PortfolioAnalytics/man/gmv_opt_ptc.Rd
   pkg/PortfolioAnalytics/man/gmv_opt_toc.Rd
   pkg/PortfolioAnalytics/man/maxret_milp_opt.Rd
   pkg/PortfolioAnalytics/man/maxret_opt.Rd
Log:
Adding ROI.plugin.cplex to Suggests and support for control argument in ROI_solve

Modified: pkg/PortfolioAnalytics/DESCRIPTION
===================================================================
--- pkg/PortfolioAnalytics/DESCRIPTION	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/DESCRIPTION	2014-04-20 16:38:03 UTC (rev 3375)
@@ -25,6 +25,7 @@
     ROI.plugin.glpk (>= 0.0.2),
     ROI.plugin.quadprog (>= 0.0.2),
     ROI.plugin.symphony (>= 0.0.2),
+    ROI.plugin.cplex (>= 0.0.2),
     pso,
     GenSA,
     corpcor,

Modified: pkg/PortfolioAnalytics/R/optFUN.R
===================================================================
--- pkg/PortfolioAnalytics/R/optFUN.R	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/R/optFUN.R	2014-04-20 16:38:03 UTC (rev 3375)
@@ -13,10 +13,12 @@
 #' @param lambda_hhi concentration aversion parameter
 #' @param conc_groups list of vectors specifying the groups of the assets.
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-gmv_opt <- function(R, constraints, moments, lambda, target, lambda_hhi, conc_groups, solver="quadprog"){
-  stopifnot("package:ROI" %in% search() || require("ROI", quietly = TRUE))
-  stopifnot("package:ROI.plugin.quadprog" %in% search() || require("ROI.plugin.quadprog", quietly = TRUE))
+gmv_opt <- function(R, constraints, moments, lambda, target, lambda_hhi, conc_groups, solver="quadprog", control=NULL){
+  stopifnot("package:ROI" %in% search() || require("ROI", quietly=TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -129,7 +131,7 @@
   opt.prob <- OP(objective=ROI_objective, 
                        constraints=L_constraint(L=Amat, dir=dir.vec, rhs=rhs.vec),
                  bounds=bnds)
-  result <- try(ROI_solve(x=opt.prob, solver=solver), silent=TRUE)
+  result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
   
   # result <- try(solve.QP(Dmat=Dmat, dvec=dvec, Amat=t(Amat), bvec=rhs.vec, meq=meq), silent=TRUE)
   if(inherits(x=result, "try-error")) stop(paste("No solution found:", result))
@@ -171,10 +173,12 @@
 #' @param moments object of moments computed based on objective functions
 #' @param target target return value
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-maxret_opt <- function(R, moments, constraints, target, solver="glpk"){
+maxret_opt <- function(R, moments, constraints, target, solver="glpk", control=NULL){
   stopifnot("package:ROI" %in% search() || require("ROI",quietly = TRUE))
-  stopifnot("package:ROI.plugin.glpk" %in% search() || require("ROI.plugin.glpk",quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -235,7 +239,8 @@
   opt.prob <- OP(objective=ROI_objective, 
                  constraints=L_constraint(L=Amat, dir=dir.vec, rhs=rhs.vec),
                  bounds=bnds)
-  roi.result <- ROI_solve(x=opt.prob, solver=solver)
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
+  if(inherits(roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   # roi.result <- Rglpk_solve_LP(obj=objL, mat=Amat, dir=dir.vec, rhs=rhs.vec, bounds=bnds)
   
@@ -276,10 +281,12 @@
 #' @param moments object of moments computed based on objective functions
 #' @param target target return value
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-maxret_milp_opt <- function(R, constraints, moments, target, solver="glpk"){
+maxret_milp_opt <- function(R, constraints, moments, target, solver="glpk", control=NULL){
   stopifnot("package:ROI" %in% search() || require("ROI",quietly = TRUE))
-  stopifnot("package:ROI.plugin.glpk" %in% search() || require("ROI.plugin.glpk",quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -369,7 +376,7 @@
   opt.prob <- OP(objective=ROI_objective, 
                  constraints=L_constraint(L=Amat, dir=dir, rhs=rhs),
                  bounds=bnds, types=types)
-  roi.result <- try(ROI_solve(x=opt.prob, solver=solver), silent=TRUE)
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
   if(inherits(roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   # Weights
@@ -400,10 +407,12 @@
 #' @param target target return value
 #' @param alpha alpha value for ETL/ES/CVaR
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-etl_opt <- function(R, constraints, moments, target, alpha, solver="glpk"){
+etl_opt <- function(R, constraints, moments, target, alpha, solver="glpk", control=NULL){
   stopifnot("package:ROI" %in% search() || require("ROI",quietly = TRUE))
-  stopifnot("package:ROI.plugin.glpk" %in% search() || require("ROI.plugin.glpk",quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -456,7 +465,7 @@
   opt.prob <- OP(objective=ROI_objective, 
                        constraints=L_constraint(L=Amat, dir=dir.vec, rhs=rhs.vec),
                        bounds=bnds)
-  roi.result <- try(ROI_solve(x=opt.prob, solver=solver), silent=TRUE)
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
   if(inherits(x=roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   weights <- roi.result$solution[1:N]
@@ -498,10 +507,12 @@
 #' @param target target return value
 #' @param alpha alpha value for ETL/ES/CVaR
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-etl_milp_opt <- function(R, constraints, moments, target, alpha, solver="glpk"){
+etl_milp_opt <- function(R, constraints, moments, target, alpha, solver="glpk", control=NULL){
   stopifnot("package:ROI" %in% search() || require("ROI",quietly = TRUE))
-  stopifnot("package:ROI.plugin.glpk" %in% search() || require("ROI.plugin.glpk",quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -605,7 +616,8 @@
   opt.prob <- OP(objective=ROI_objective, 
                  constraints=L_constraint(L=tmpAmat, dir=dir, rhs=rhs),
                  bounds=bnds, types=types)
-  roi.result <- ROI_solve(x=opt.prob, solver=solver)
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
+  if(inherits(roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   # The Rglpk solvers status returns an an integer with status information
   # about the solution returned: 0 if the optimal solution was found, a 
@@ -654,12 +666,14 @@
 #' @param target target return value
 #' @param init_weights initial weights to compute turnover
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-gmv_opt_toc <- function(R, constraints, moments, lambda, target, init_weights, solver="quadprog"){
+gmv_opt_toc <- function(R, constraints, moments, lambda, target, init_weights, solver="quadprog", control=NULL){
   # function for minimum variance or max quadratic utility problems
   stopifnot("package:corpcor" %in% search() || require("corpcor",quietly = TRUE))
   stopifnot("package:ROI" %in% search() || require("ROI", quietly = TRUE))
-  stopifnot("package:ROI.plugin.quadprog" %in% search() || require("ROI.plugin.quadprog", quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -766,8 +780,7 @@
   opt.prob <- OP(objective=ROI_objective, 
                  constraints=L_constraint(L=Amat, dir=dir, rhs=rhs))
   
-  roi.result <- try(ROI_solve(x=opt.prob, solver=solver), silent=TRUE)
-  
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
   if(inherits(roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   wts <- roi.result$solution
@@ -810,13 +823,15 @@
 #' @param target target return value
 #' @param init_weights initial weights to compute turnover
 #' @param solver solver to use
+#' @param control list of solver control parameters
 #' @author Ross Bennett
-gmv_opt_ptc <- function(R, constraints, moments, lambda, target, init_weights, solver="quadprog"){
+gmv_opt_ptc <- function(R, constraints, moments, lambda, target, init_weights, solver="quadprog", control=NULL){
   # function for minimum variance or max quadratic utility problems
   # modifying ProportionalCostOpt function from MPO package
   stopifnot("package:corpcor" %in% search() || require("corpcor", quietly = TRUE))
   stopifnot("package:ROI" %in% search() || require("ROI", quietly = TRUE))
-  stopifnot("package:ROI.plugin.quadprog" %in% search() || require("ROI.plugin.quadprog", quietly = TRUE))
+  plugin <- paste0("ROI.plugin.", solver)
+  stopifnot(paste0("package:", plugin) %in% search() || require(plugin, quietly=TRUE, character.only=TRUE))
   
   # Check for cleaned returns in moments
   if(!is.null(moments$cleanR)) R <- moments$cleanR
@@ -911,8 +926,7 @@
   
   opt.prob <- OP(objective=ROI_objective, 
                  constraints=L_constraint(L=Amat, dir=dir, rhs=rhs))
-  roi.result <- try(ROI_solve(x=opt.prob, solver=solver), silent=TRUE)
-
+  roi.result <- try(ROI_solve(x=opt.prob, solver=solver, control=control), silent=TRUE)
   if(inherits(roi.result, "try-error")) stop(paste("No solution found:", roi.result))
   
   wts <- roi.result$solution
@@ -948,31 +962,31 @@
 # This function uses optimize() to find the target return value that 
 # results in the maximum starr ratio (mean / ES).
 # returns the target return value
-mean_etl_opt <- function(R, constraints, moments, alpha, solver){
+mean_etl_opt <- function(R, constraints, moments, alpha, solver, control){
   # create a copy of the moments that can be modified
   tmp_moments <- moments
   
   # Find the maximum return
   if(!is.null(constraints$max_pos)){
-    max_ret <- maxret_milp_opt(R=R, constraints=constraints, moments=moments, target=NA, solver=solver)
+    max_ret <- maxret_milp_opt(R=R, constraints=constraints, moments=moments, target=NA, solver=solver, control=control)
   } else {
-    max_ret <- maxret_opt(R=R, moments=moments, constraints=constraints, target=NA, solver=solver)
+    max_ret <- maxret_opt(R=R, moments=moments, constraints=constraints, target=NA, solver=solver, control=control)
   }
   max_mean <- as.numeric(-max_ret$out)
   
   # Find the minimum return
   tmp_moments$mean <- -1 * moments$mean
   if(!is.null(constraints$max_pos)){
-    min_ret <- maxret_milp_opt(R=R, constraints=constraints, moments=tmp_moments, target=NA, solver=solver)
+    min_ret <- maxret_milp_opt(R=R, constraints=constraints, moments=tmp_moments, target=NA, solver=solver, control=control)
   } else {
-    min_ret <- maxret_opt(R=R, constraints=constraints, moments=tmp_moments, target=NA, solver=solver)
+    min_ret <- maxret_opt(R=R, constraints=constraints, moments=tmp_moments, target=NA, solver=solver, control=control)
   }
   min_mean <- as.numeric(min_ret$out)
   
   # use optimize() to find the target return value that maximizes sharpe ratio
   opt <- try(optimize(f=starr_obj_fun, R=R, constraints=constraints, 
                       solver=solver, moments=moments, alpha=alpha,
-                      lower=min_mean, upper=max_mean, 
+                      lower=min_mean, upper=max_mean, control=control,
                       maximum=TRUE, tol=.Machine$double.eps), 
              silent=TRUE)
   if(inherits(opt, "try-error")){
@@ -984,13 +998,15 @@
 
 # Function to calculate the starr ratio.
 # Used as the objective function for optimize()
-starr_obj_fun <- function(target_return, R, constraints, moments, alpha, solver){
+starr_obj_fun <- function(target_return, R, constraints, moments, alpha, solver, control){
   if(!is.null(constraints$max_pos)){
     opt <- etl_milp_opt(R=R, constraints=constraints, moments=moments, 
-                        target=target_return, alpha=alpha, solver=solver)
+                        target=target_return, alpha=alpha, solver=solver, 
+                        control=control)
   } else {
     opt <- etl_opt(R=R, constraints=constraints, moments=moments, 
-                   target=target_return, alpha=alpha, solver=solver)
+                   target=target_return, alpha=alpha, solver=solver,
+                   control=control)
   }
   weights <- matrix(opt$weights, ncol=1)
   opt_mean <- as.numeric(t(weights) %*% matrix(moments$mean, ncol=1))
@@ -1132,10 +1148,10 @@
 
 # Function to calculate the sharpe ratio.
 # Used as the objective function for optimize()
-sharpe_obj_fun <- function(target_return, R, constraints, moments, lambda_hhi=NULL, conc_groups=NULL, solver="quadprog"){
+sharpe_obj_fun <- function(target_return, R, constraints, moments, lambda_hhi=NULL, conc_groups=NULL, solver="quadprog", control=control){
   opt <- gmv_opt(R=R, constraints=constraints, moments=moments, lambda=1, 
-                 target=target_return, lambda_hhi=lambda_hhi, 
-                 conc_groups=conc_groups, solver=solver)
+                 target=target_return, lambda_hhi=lambda_hhi,
+                 conc_groups=conc_groups, solver=solver, control=control)
   weights <- opt$weights
   opt_mean <- as.numeric(t(weights) %*% matrix(moments$mean, ncol=1))
   opt_sd <- as.numeric(sqrt(t(weights) %*% moments$var %*% weights))
@@ -1146,25 +1162,25 @@
 # This function uses optimize() to find the target return value that 
 # results in the maximum sharpe ratio (mean / sd).
 # returns the target return value
-max_sr_opt <- function(R, constraints, moments, lambda_hhi, conc_groups, solver){
+max_sr_opt <- function(R, constraints, moments, lambda_hhi, conc_groups, solver, control){
   # create a copy of the moments that can be modified
   tmp_moments <- moments
   
   # Find the maximum return
   max_ret <- maxret_opt(R=R, moments=moments, constraints=constraints, 
-                        target=NA, solver="glpk")
+                        target=NA, solver=solver, control=control)
   max_mean <- as.numeric(-max_ret$out)
   
   # Find the minimum return
   tmp_moments$mean <- -1 * moments$mean
   min_ret <- maxret_opt(R=R, moments=tmp_moments, constraints=constraints, 
-                        target=NA, solver="glpk")
+                        target=NA, solver=solver, control=control)
   min_mean <- as.numeric(min_ret$out)
   
   # use optimize() to find the target return value that maximizes sharpe ratio
   opt <- try(optimize(f=sharpe_obj_fun, R=R, constraints=constraints, 
                       solver=solver, lambda_hhi=lambda_hhi, 
-                      conc_groups=conc_groups, moments=moments, 
+                      conc_groups=conc_groups, moments=moments, control=control,
                       lower=min_mean, upper=max_mean, 
                       maximum=TRUE, tol=.Machine$double.eps), 
              silent=TRUE)

Modified: pkg/PortfolioAnalytics/R/optimize.portfolio.R
===================================================================
--- pkg/PortfolioAnalytics/R/optimize.portfolio.R	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/R/optimize.portfolio.R	2014-04-20 16:38:03 UTC (rev 3375)
@@ -757,8 +757,11 @@
   
   roi_solvers <- c("ROI", "quadprog", "glpk", "symphony", "ipop", "cplex")
   if(optimize_method %in% roi_solvers){
+    # check for a control argument for list of solver control arguments
+    if(hasArg(control)) control=match.call(expand.dots=TRUE)$control else control=NULL
+    
     # This takes in a regular portfolio object and extracts the constraints and
-    #  objectives and converts them for input. to a closed form solver using
+    # objectives and converts them for input. to a closed form solver using
     # ROI as an interface.
     moments <- list(mean=rep(0, N))
     alpha <- 0.05
@@ -840,14 +843,14 @@
           constraints$ptc <- NULL
         }
         if(!is.null(constraints$turnover_target) & is.null(constraints$ptc)){
-          qp_result <- gmv_opt_toc(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, init_weights=portfolio$assets, solver=solver)
+          qp_result <- gmv_opt_toc(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, init_weights=portfolio$assets, solver=solver, control=control)
           weights <- qp_result$weights
           # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
           obj_vals <- qp_result$obj_vals
           out <- list(weights=weights, objective_measures=obj_vals, opt_values=obj_vals, out=qp_result$out, call=call)
         }
         if(!is.null(constraints$ptc) & is.null(constraints$turnover_target)){
-          qp_result <- gmv_opt_ptc(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, init_weights=portfolio$assets, solver=solver)
+          qp_result <- gmv_opt_ptc(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, init_weights=portfolio$assets, solver=solver, control=control)
           weights <- qp_result$weights
           # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
           obj_vals <- qp_result$obj_vals
@@ -857,12 +860,12 @@
         # if(hasArg(ef)) ef=match.call(expand.dots=TRUE)$ef else ef=FALSE
         if(hasArg(maxSR)) maxSR=match.call(expand.dots=TRUE)$maxSR else maxSR=FALSE
         if(maxSR){
-          target <- max_sr_opt(R=R, constraints=constraints, moments=moments, lambda_hhi=lambda_hhi, conc_groups=conc_groups, solver=solver)
+          target <- max_sr_opt(R=R, constraints=constraints, moments=moments, lambda_hhi=lambda_hhi, conc_groups=conc_groups, solver=solver, control=control)
           # need to set moments$mean=0 here because quadratic utility and target return is sensitive to returning no solution
           tmp_moments_mean <- moments$mean
           moments$mean <- rep(0, length(moments$mean))
         }
-        roi_result <- gmv_opt(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, lambda_hhi=lambda_hhi, conc_groups=conc_groups, solver=solver)
+        roi_result <- gmv_opt(R=R, constraints=constraints, moments=moments, lambda=lambda, target=target, lambda_hhi=lambda_hhi, conc_groups=conc_groups, solver=solver, control=control)
         weights <- roi_result$weights
         # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
         obj_vals <- roi_result$obj_vals
@@ -887,14 +890,14 @@
       # Maximize return if the only objective specified is mean
       if(!is.null(constraints$max_pos) | !is.null(constraints$leverage)) {
         # This is an MILP problem if max_pos is specified as a constraint
-        roi_result <- maxret_milp_opt(R=R, constraints=constraints, moments=moments, target=target, solver=solver)
+        roi_result <- maxret_milp_opt(R=R, constraints=constraints, moments=moments, target=target, solver=solver, control=control)
         weights <- roi_result$weights
         # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
         obj_vals <- roi_result$obj_vals
         out <- list(weights=weights, objective_measures=obj_vals, opt_values=obj_vals, out=roi_result$out, call=call)
       } else {
         # Maximize return LP problem
-        roi_result <- maxret_opt(R=R, constraints=constraints, moments=moments, target=target, solver=solver)
+        roi_result <- maxret_opt(R=R, constraints=constraints, moments=moments, target=target, solver=solver, control=control)
         weights <- roi_result$weights
         # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
         obj_vals <- roi_result$obj_vals
@@ -918,12 +921,12 @@
       # Minimize sample ETL/ES/CVaR if CVaR, ETL, or ES is specified as an objective
       if(length(moments) == 2 & all(moments$mean != 0) & ef==FALSE & maxSTARR){
         # This is called by meanetl.efficient.frontier and we do not want that for efficient frontiers, need to have ef==FALSE
-        target <- mean_etl_opt(R=R, constraints=constraints, moments=moments, alpha=alpha, solver=solver)
+        target <- mean_etl_opt(R=R, constraints=constraints, moments=moments, alpha=alpha, solver=solver, control=control)
         meanetl <- TRUE
       }
       if(!is.null(constraints$max_pos)) {
         # This is an MILP problem if max_pos is specified as a constraint
-        roi_result <- etl_milp_opt(R=R, constraints=constraints, moments=moments, target=target, alpha=alpha, solver=solver)
+        roi_result <- etl_milp_opt(R=R, constraints=constraints, moments=moments, target=target, alpha=alpha, solver=solver, control=control)
         weights <- roi_result$weights
         # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
         # obj_vals <- roi_result$obj_vals
@@ -934,7 +937,7 @@
         out <- list(weights=weights, objective_measures=obj_vals, opt_values=obj_vals, out=roi_result$out, call=call)
       } else {
         # Minimize sample ETL/ES/CVaR LP Problem
-        roi_result <- etl_opt(R=R, constraints=constraints, moments=moments, target=target, alpha=alpha, solver=solver)
+        roi_result <- etl_opt(R=R, constraints=constraints, moments=moments, target=target, alpha=alpha, solver=solver, control=control)
         weights <- roi_result$weights
         # obj_vals <- constrained_objective(w=weights, R=R, portfolio, trace=TRUE, normalize=FALSE)$objective_measures
         # obj_vals <- roi_result$obj_vals

Modified: pkg/PortfolioAnalytics/man/etl_milp_opt.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/etl_milp_opt.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/etl_milp_opt.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{Minimum ETL MILP Optimization}
 \usage{
   etl_milp_opt(R, constraints, moments, target, alpha,
-    solver = "glpk")
+    solver = "glpk", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -19,6 +19,8 @@
   \item{alpha}{alpha value for ETL/ES/CVaR}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/etl_opt.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/etl_opt.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/etl_opt.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{Minimum ETL LP Optimization}
 \usage{
   etl_opt(R, constraints, moments, target, alpha,
-    solver = "glpk")
+    solver = "glpk", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -19,6 +19,8 @@
   \item{alpha}{alpha value for ETL/ES/CVaR}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/gmv_opt.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/gmv_opt.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/gmv_opt.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,8 @@
 \title{GMV/QU QP Optimization}
 \usage{
   gmv_opt(R, constraints, moments, lambda, target,
-    lambda_hhi, conc_groups, solver = "quadprog")
+    lambda_hhi, conc_groups, solver = "quadprog",
+    control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -24,6 +25,8 @@
   of the assets.}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/gmv_opt_ptc.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/gmv_opt_ptc.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/gmv_opt_ptc.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{GMV/QU QP Optimization with Proportional Transaction Cost Constraint}
 \usage{
   gmv_opt_ptc(R, constraints, moments, lambda, target,
-    init_weights, solver = "quadprog")
+    init_weights, solver = "quadprog", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -21,6 +21,8 @@
   \item{init_weights}{initial weights to compute turnover}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/gmv_opt_toc.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/gmv_opt_toc.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/gmv_opt_toc.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{GMV/QU QP Optimization with Turnover Constraint}
 \usage{
   gmv_opt_toc(R, constraints, moments, lambda, target,
-    init_weights, solver = "quadprog")
+    init_weights, solver = "quadprog", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -21,6 +21,8 @@
   \item{init_weights}{initial weights to compute turnover}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/maxret_milp_opt.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/maxret_milp_opt.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/maxret_milp_opt.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{Maximum Return MILP Optimization}
 \usage{
   maxret_milp_opt(R, constraints, moments, target,
-    solver = "glpk")
+    solver = "glpk", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -17,6 +17,8 @@
   \item{target}{target return value}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve

Modified: pkg/PortfolioAnalytics/man/maxret_opt.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/maxret_opt.Rd	2014-04-19 04:03:15 UTC (rev 3374)
+++ pkg/PortfolioAnalytics/man/maxret_opt.Rd	2014-04-20 16:38:03 UTC (rev 3375)
@@ -3,7 +3,7 @@
 \title{Maximum Return LP Optimization}
 \usage{
   maxret_opt(R, moments, constraints, target,
-    solver = "glpk")
+    solver = "glpk", control = NULL)
 }
 \arguments{
   \item{R}{xts object of asset returns}
@@ -17,6 +17,8 @@
   \item{target}{target return value}
 
   \item{solver}{solver to use}
+
+  \item{control}{list of solver control parameters}
 }
 \description{
   This function is called by optimize.portfolio to solve



More information about the Returnanalytics-commits mailing list