Search⌘ K
AI Features

Challenge: Constrained Optimization

Explore constrained optimization techniques by applying entropy maximization to diversify a stock portfolio while meeting average return constraints. Learn to formulate investment allocation problems with mathematical constraints and implement solutions that satisfy nonnegativity and return thresholds.

Problem statement

Suppose you have $10000 to invest in the stock market and you want to diversify your portfolio among three different stocks: Stock 1 (STK1), Stock 2 (STK2), and Stock 3 (STK3). You have the following information on the expected return of these three stocks based on their five-year compound annual growth rate (CAGR):

Stock (xi)

Expected Return in % (μi)

STK1

15

STK2

12

STK3

25

Mathematical formulation

Assuming that x1,x2,x3x_1,x_2,x_3 denote the fraction of each stock (STK1, STK2, STK3) in the portfolio, you will want to maximize the diversity of the portfolio given by the following function:

subject to the following constraints:

  • 15x1+12x2+25x3μ15x_1 + 12x_2 + 25x_3 \geq \mu : Ensuring an average portfolio return of μ\mu % per year

  • x1,x2,x30x_1, x_2, x_3 \geq 0 ...