
I just tried my last suggested method, modifying the code of the second answer here:
http://mathematica.stackexchange.com/qu ... -of-stocks
This was for 10 choose 5 stocks. It seemed to run fine and produced the above frontier in about 100 secs.
A check on the output shows that 5 weights were indeed exactly 0 at each expected return level.
(Note the example, before my modification, starts with the constraints [$]0 \le w_i \le 1[$]).
My modified code was:
newconstraint
If[w1>0,1,0]+If[w10>0,1,0]+If[w2>0,1,0]+If[w3>0,1,0]+If[w4>0,1,0]+
If[w5>0,1,0]+If[w6>0,1,0]+If[w7>0,1,0]+If[w8>0,1,0]+If[w9>0,1,0]==5
effFrontier2 = Table[{Sqrt[NMinimize[{portVar,Total[weights]==1 && portAverageReturns == i &&
newconstraint && And @@(0<=#<=1&/@weights)},weights,
Method->"DifferentialEvolution",MaxIterations->500][[1]]],i},{i,0.1,0.7,.1}]//Quiet
Perhaps you can port the thing to R.