CS计算机代考程序代写 algorithm finance AI City University of Hong Kong Department of Economics and Finance

City University of Hong Kong Department of Economics and Finance
Course EF5213 Assignment #3 ( due March 28, 2021 ) 1. Consider the MVO problem that determines the optimal portfolio content w and w0 by minimizing the
portfolio risk as
minimize 1 wT w 2
subject to wT  w0 0  p , uTw  w0  1 , and a1  w1  b1 , … , an  wn  bn
given portfolio mean return p, riskfree rate 0, asset mean returns , and their variance-covariance . There are buy and sell limits in the optimization according to the given positive quantities {a1, … , an} and {b1, … , bn}. It should be noted that the optimal portfolio content can be determined through the Kuhn-Tucker conditions as
MVO problem.
Consider the following procedures in your implementation:
L (w10 1 u)i 0 when ai wi bi
wi
Modify the Markowitz algorithm in the lecture and develop a VBA implementation for the current
 0 when wi  ai
 0 when wi  bi , for i  0, 1, … , n
(1) Define an OUT subset , and separate  into two disjoint subsets A and B. Consider the MVO problem with wi  bi for i  B, and wi  ai for i  A. The optimal solution of this MVO problem is
given by
w  1 (1m  0 1um)  1h , where hi  { bi , i  B , and i  jA ij aj  jB ij ( b )
ai ,iA mmmi,i j
w0 1uTw
   uT1hT1h
1p00m m Cm20  2Am0 Bm
(80 points)
Here, {m, m, um} refer to the modified versions of {, , u} according to the assets in the OUT subset .
(2) Check that all the entries of w satisfy both the buy and sell limits. If so, proceed to step (3). If this is not the case, return to step (1) and try another separation of  or another OUT subset.
(3) Check that KKT conditions have been satisfied. If so, w0 and w defined in (1) will be an optimal solution. Otherwise, return to step (1) and try another separation of  or another OUT subset.

Some useful comments:
Suppose OUT subset  is given by I( 1 : Nc, 1 : Nout ).
Referring to label L with content I( L, 1 : Nout ), we want to generate the disjoint subsets as
IA( 1 : Mc, 1 : Nout  Mout ) and IB( 1 : Mc, 1 : Mout ) with label from 1 to Mc where Mout runs from 0 to Nout .
Consider the following algorithm.
If( Mout  0 ) then
IB is empty and IA has the same content as I.
There is Mc  1 possibility with label H  1 only elseif( Mout  1) then
IB takes one element in I, and IA keeps the rest.
There are Mc  Nout possibilities with different labels H  1 to Mc
elseif( Mout  2 ) then
Mc  H endif
̅̅ ̅̅
IB( 1 : Mc, 1 : Mout  1) and IA( 1 : Mc, 1 : Nout  (Mout  1) )
IB( 1 : Mc, 1 : Mout ) and IA( 1 : Mc, 1 : Nout  Mout ) ̅̅
From previous
Generate current
H0
For ( Running through previous label H  1 to Mc) {
̅
For ( Running through the content of previous IA, i  1 to Nout  (Mout  1) ){
HH1
IB( H, 1 : Mout )  IB(H, 1 : Mout  1) plus the i-th entry in IA (H, 1 : Nout  (Mout  1) )
̅̅ ̅̅ ̅̅
IA( H, 1 : Nout  Mout )  IA (H, 1 : Nout  (Mout  1) ) excluding the i-th entry }
}