Asset Allocation in Python

Asset allocation is the most important decision that any investor needs to face, and there is no one-size-fits-all solution that can work for each and every investor. By asset allocation, we mean spreading the investor's total investment amount over certain assets (be it stocks, options, bonds, or any other financial instruments). When considering the allocation, the investor wants to balance the risk and the potential reward. At the same time, the allocation is dependent on factors such as the individual goals (expected return), risk tolerance (how much risk is the investor willing to accept), or the investment horizon (short or long-term investment).

The key framework in asset allocation is the modern portfolio theory (MPT, also known as mean-variance analysis). It was introduced by the Nobel recipient Harry Markowitz and describes how risk-averse investors can construct portfolios to maximize their expected returns (profits) for a given level of risk. The main insight from MPT is that investors should not evaluate an asset's performance alone (by metrics such as expected return or volatility), but instead investigate how it would impact the performance of their portfolio of assets.

MPT is closely related to the concept of diversification, which simply means that owning different kinds of assets reduces risk, as the loss or gain of a particular security has less impact on the portfolio’s performance. Another key concept to be aware of is that while the portfolio return is the weighted average of the individual asset returns, this is not true for the risk (volatility). It is also dependent on the correlations between the assets. What is interesting is that thanks to optimized asset allocation, it is possible to have a portfolio with lower volatility than the lowest individual volatility of the assets in the portfolio. In principle, the lower the correlation between the assets we hold, the better it is for diversification. With a perfect negative correlation, we could diversify all the risk.

The main assumptions of modern portfolio theory are:

  • Investors are rational and aim to maximize their returns, while avoiding risks whenever possible.
  • Investors share the goal to maximize their expected returns.
  • All investors have the same level of information about potential investments.
  • Commissions, taxes, and transaction costs are not taken into account.
  • Investors can borrow and lend money (without limits) at a risk-free rate.

In this chapter, we start with the most basic asset allocation strategy, and on its basis learn how to evaluate the performance of portfolios (also applicable to individual assets). Later on, we show three different approaches to obtaining the Efficient Frontier, while also relaxing some of the assumptions of MPT. One of the main benefits of learning how to approach optimization problems is that they can be easily refactored, for example, optimizing a different objective function. This requires only slight modifications to the code, while the majority of the framework stays the same.

We cover the following recipes in this chapter:

  • Evaluating the performance of a basic 1/n portfolio
  • Finding the Efficient Frontier using Monte Carlo simulations
  • Finding the Efficient Frontier using optimization with scipy
  • Finding the Efficient Frontier using convex optimization with cvxpy
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.64.72