Skip to content

Mean-Semivariance (downside risk) Portfolio Construction

1 message · Brian G. Peterson

#
Gabe,

Since no one has answered your question regarding fPortfolio, and I 
can't really help with that in this context, I've done an example using 
PortfolioAnalytics.

Here's an example that maximizes Sortino Ratio, given some MAR.

It takes about 15 seconds to run the example on my machine, using 
multicore and random portfolios.  DEoptim will also work, but will be 
slower. Larger portfolios will obviously take longer to optimize.

If you're on Windows, you will have to modify (or simply comment out) 
the lines:
require(doMC)
registerDoMC()

If you want some different objective, let me know, and I can work that 
up too.  This only took a few minutes to put together.

I did have to make some small modifications to the SortinoRatio function 
in PerformanceAnalytics to make it 'portfolio-aware'.  I've attached a 
file you can 'source()' here, and this will be on R-Forge later today, 
and in the next version of PerformanceAnalytics.

There was also a small bug in the plot() method.  I will check in the 
fixed version, and it should be available as a binary download from 
R-Forge at the latest tomorrow.

PortfolioAnalytics, by default, assumes a full investment constraint 
(all weights sum to 1), though this may be turned off if your 
constraints differ.

Regards,

   - Brian
On 10/31/2010 08:19 PM, Gabe Plaxico wrote: