Simple Portfolio Optimization with Python

preview_player
Показать описание
We have done various optimization problems in past videos including using it to fit regression models, find the optimal angle to hit a baseball to maximize distance traveled, gradient descent, and probably others that I can’t recall. Here, we will try to optimize a portfolio-- at least in a backwards looking sort of way. We will do two optimizations: first is a simple, almost trivial case of maximizing returns, the second is using a Sharpe ratio.

It should be obvious, but I will say it anyway. This is for teaching purposes only and one shouldn’t build a portfolio on this without substantial backtesting.

Рекомендации по теме
Комментарии
Автор


When having more than 2 assets in the portfolio, a Linear Algebraic implementation in Python would be: np.sqrt(np.dot(np.dot(alloc.T, df.cov().to_numpy()), alloc)).

Good work for the rest part, thanks.

markzhang
visit shbcf.ru