[R-SIG-Finance] Genetic Algorithms & Portfolio Optimization

Lui ## lui.r.project at googlemail.com
Sat Jan 22 23:33:09 CET 2011

Dear group,

I was just wondering whether some of you have some experience with the
package "rgenoud" which does provide genetic algorithms for complex
optimization problems. How did you efficiently solve the constraints
(sum of all weights <1, variance < target)? Setting the solution
"infeasible" through if-clauses did not seem to be so promising ...
The example below shows what I mean:


if (variance > targetvariance){
penatly = -999999

"result" is to be maximized, the variance should not exceed a certain
threeshold. To me, it seemed much better to add a penalty term like

penalty = ( (abs(variance-targetvariance)/targetvariance)*100)^50

What is your general experience? Did you ever try solving the
Markowitz portfolio with the rgenoud package?
I know that there are good solvers around for the qudratic programming
problem of the markowitz portfolio, but I want to go into a different
direction which translates into a quadratic problem with quadratic
constraints (and I havent found a good solver for that...).

I am interested in your replies! Have a good weekend!


More information about the R-SIG-Finance mailing list