PyPortfolioOpt icon indicating copy to clipboard operation
PyPortfolioOpt copied to clipboard

Optimizing for max sortino

Open cemozerr opened this issue 3 years ago • 3 comments

What are you trying to do? I'm trying to optimize for max sortino using PyPortfolioOpt.

What have you tried? I've gone through the EfficientSemivariance docs, but could not find a function to optimize for max sortino.

Is there a simple way to do this?

cemozerr avatar Dec 15 '21 17:12 cemozerr

Hi @cemozerr,

I'm not sure how one might do that (apart from looping through a range of returns, using efficient_returns, then selecting the max).

Even max sharpe requires a nontrivial variable transformation to make it convex – it's not obvious to me how to do this transformation for Sortino.

Maybe @phschiele has come across some technique for it?

Best, Robert

robertmartin8 avatar Dec 20 '21 07:12 robertmartin8

This would definitely require some work to get it right using the "exact" formulation of the efficient semivariance. For now, looping over the returns or maximizing the Sharpe ratio using the semi covariance matrix (i.e., Estrada's method) seem like good approaches. Seems like a fun project to dig into the details, though, so perhaps I'll look into it at some point.

phschiele avatar Jan 26 '22 21:01 phschiele

I like this idea too. I think the use case for the sortino is crypto... the sharpe penalizes big upsides (though im probably butchering that explanation) but thats kinda what some people want outta crypto :)

@phschiele listed two workarounds so ill give at least one of them a try (probably maximizing the Sharpe ratio using the semi covariance matrix).

Thanks!

brettelliot avatar Feb 07 '22 00:02 brettelliot