# Efficient Portfolio Optimization Through Simulation

Apologies in advance for the (possibly?) poor terminology as I'm a bit of a novice in the field. I was torn whether to ask this on stackoverflow or here, so hope its the right place.

Anyway, my problem is I'm trying to efficiently calculate the best weights for a portfolio of assets that will maximize the sharpe ratio (or similar measure of risk adjusted returns) of the portfolio as a whole, where portfolio returns are unknown, non-normal and dependent on each other, but simulated by a seperate function.

The processing chain is as follows:

1. Simulate returns from portfolio (I already have this part; assume that the simulation uses a VAR Copula Garch model incorporating all assets in the portfolio, though how it arrives at the simulation is not important for this question, just that the asset returns are not independent but can be simulated.)
2. Calculate weights for each asset that will maximize some risk/return measure (e.g. sharpe ratio) of the whole portfolio
3. Repeat above until stable points are found (e.g. each 'simulation' is very noisy by itself/far from the average over all simulations).

I thought of doing this the brute force way via monte carlo simulation, but thought it best to seek expert advise first. So my question is essentially:

1. How would you recommend I go about doing the above in R.
2. Are there any packages, algorithms or resources you would recommend I use/look into for this task? Goal is to have a proof of concept up asap, and if the ideas show practical utility to delve deeper into the theory and better methods.

The easier it is to get setup the better; ideal would be recommendation on a flexible/efficient optimization framework allowing constraint specification (e.g. can have negative weights; must not have above 20%, must not be below 2% (else %0 weighted) etc... Yes, it would be nice if it also included a free lunch ;-) )

Thank you for taking the time to read this, and any thoughts or comments you have in advance!

-
I think this question is fine here, and probably a better fit than SO; do note that there is also a quant.SE as well. In the event it doesn't get the answer you are looking for here, it could potentially be migrated there later. –  cardinal Jul 10 '12 at 17:19
Thanks for the response, I'll try the quant section if this doesn't work out. –  psandersen Jul 10 '12 at 17:36
This definitely would be better suited to quant.SE. I would also suggest breaking apart the question and looking at some of the individual components separately. For instance, I recall that they had recently had a discussion about the kind of constraint where it was not below x% otherwise 0%. Anyway, most of the individual stuff you're talking about (garch/copula/optimization) have R toolboxes, just google search for them. However, you'll have to do some programming to bring everythign together. –  John Jul 10 '12 at 18:07
Also, your third point seems like Michaud resampling. I'm not sure I recall any packages that do that off the top of my head. However, I would think that if you do 10,000 or so simulations to generate your efficient frontier it wouldn't be that noisy. –  John Jul 10 '12 at 18:09