1. Learn
  2. /
  3. Courses
  4. /
  5. GARCH Models in Python

Connected

Exercise

Compute dynamic portfolio variance

In this exercise, you will practice computing the variance of a simple two-asset portfolio with GARCH dynamic covariance.

The Modern Portfolio Theory states that there is an optimal way to construct a portfolio to take advantage of the diversification effect, so one can obtain a desired level of expected return with the minimum risk. This effect is especially evident when the covariance between asset returns is negative.

Suppose you have a portfolio with only two assets: EUR/USD and CAD/USD currency pairs. Their variance from the GARCH models have been saved in variance_eur and variance_cad, and their covariance has been calculated and saved in covariance. Compute the overall portfolio variances by varying the weights of the two assets, and visualize their differences.

Instructions

100 XP
  • Set the EUR/USD weight Wa1 in portfolio a to 0.9, and Wb1 in portfolio b to 0.5.
  • Calculate the variance portvar_a for portfolio a with variance_eur, variance_cad and covariance; do the same to compute portvar_b for portfolio b.