Issues modeling portfolio optimization with rebalancing in gurobipy
回答済みHi All,
I want to solve the following portfolio optimization problem by means of the Python API of Gurobi:

I have implemented the problem in the following code:

However, by inserting the constraint that rebalancing must be above a certain threshold, I obtained that the problem becomes infeasible. I computed an IIS and obtain the following .ilp file:
\ Model eff_ret_portfolio_copy
\ LP format - for model browsing. Use MPS format to capture full model detail.
Maximize
Subject To
max_number_rebalancing: C96 + C97 + C98 + C99 + C100 + C101 + C102 + C103
+ C104 + C105 + C106 + C107 + C108 + C109 + C110 + C111 + C112 + C113
+ C114 + C115 + C116 + C117 + C118 + C119 + C120 + C121 + C122 + C123
+ C124 + C125 + C126 + C127 <= 10
rebalancing_threshold[Obbligazionari_Governativi_Dollari]: [ C64 * C96 ]
>= 0.02
rebalancing_threshold[Obbligazionari_High_Yield_Euro]: [ C70 * C102 ]
>= 0.02
rebalancing_threshold[Obbligazionari_Emergenti_Hard_Currency]: [
C71 * C103 ] >= 0.02
rebalancing_threshold[Azionari_Euro]: [ C73 * C105 ] >= 0.02
rebalancing_threshold[Obbligazionari_Governativi_Breve_Termine_Europe_ex_Euro]:
[ C84 * C116 ] >= 0.02
rebalancing_threshold[Obbligazionari_Governativi_Breve_Termine_Yen]: [
C85 * C117 ] >= 0.02
rebalancing_threshold[Obbligazionari_Inflation_Linked_Dollari]: [
C87 * C119 ] >= 0.02
rebalancing_threshold[Obbligazionari_Corporate_Finanziari]: [ C89 * C121 ]
>= 0.02
rebalancing_threshold[Obbligazionari_Corporate_Dollari_Breve_Termine]: [
C91 * C123 ] >= 0.02
rebalancing_threshold[Obbligazionari_ABS]: [ C92 * C124 ] >= 0.02
rebalancing_threshold[Obbligazionari_Convertible_Euro]: [ C94 * C126 ]
>= 0.02
Bounds
C64 free
C70 free
C71 free
C73 free
C84 free
C85 free
C87 free
C89 free
C91 free
C92 free
C94 free
Binaries
C96 C97 C98 C99 C100 C101 C102 C103 C104 C105 C106 C107 C108 C109 C110
C111 C112 C113 C114 C115 C116 C117 C118 C119 C120 C121 C122 C123 C124 C125
C126 C127
End
Can you please tell me if I coded the model correctly and where the source of infeasibility is? Thanks a lot in advance.
Paolo
-
正式なコメント
Hi Paolo,
There are 11 constraints of the form
x * y >= 0.02with
ybeing a binary variable, effectively forcing all these binaries to 1 to satisfy the constraints.
Then there is the first constraint:y_1 + ... + y_11 <= 10This can never be satisfied if all 11
yvariables have to be 1.Cheers,
Matthias -
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Thanks a lot Matthias!
0
投稿コメントは受け付けていません。
コメント
3件のコメント