I have an optimization model in R that utilizes a single variable in my objective function. See below:
library(optimx) startx <- 1.25 anstestoptimx<-optimx(startx,fn=testfunc,gr=NULL, hess=NULL, lower=1, upper=1.5, method="L-BFGS-B", itnmax = 50, hessian=FALSE, control=list(save.failures=TRUE, maximize=TRUE, ndeps= 0.1, factr=0.01, kkt=FALSE, trace=1))
I'm not including the code for the objective function 'testfunc' as it is rather long. But it uses one input variable, contains several filtering routines, calculates period returns, and returns a single output (a Sharpe Ratio for a portfolio). As you can see, it utilizs the optimx package and the "L-BFGS-B" method. This code works and optimizes to a reasonable solution.
I would like to expand this objective function to include more than one variable, but do not know what packages exist for multivariable objective functions that are similar to optimx.
Can anyone recommend a package for this need? I believe that "MCO" may be a feasible option, but the documentation for MCO isn't as comprehensive as optimx so I'm not sure it will function in a similar manner.