I am trying to optimize a portfolio with 10 assets and those can be grouped into five. Say asset one and two is in group 1.
Now in my optimization, I need the weights of group assets to be equal.
For example, Asset 1 and Asset 2 is in group 1. So I need weights of asset 1 and asset 2 to be equal in the possible optimized portfolio.
How do I include this constraint into portopt function?
Many thanks in advance.
Group them prior to optimization.
For example, if a group
kconsists ofx,y,z, and you wish them to have the same weight, then just set this weight. Create synthetic:k = 1/3 * (x + y + z). Then optimize the groups, not the assets.