FTEC210 ESTR2520 Portfolio Optimization

FTEC2101/ESTR2520 Optimization Methods Spring 2023
Project Specification – Portfolio Optimization
Last Updated: March 26, 2023, Deadline: May 15, 2023, 23:59 (HKT)
So far in FTEC2101/ESTR2520, we have learnt (or will learn) a number of theories about optimization meth- ods, ranging from the simplex method for linear programming, modeling techniques for integer programming, convex optimization, gradient/Newton methods for unconstrained optimization, KKT conditions, SOCP for- mulation, etc.. Besides the theories, it is important to remember that optimization methods are practical tools for solving real world problems. The aim of the current project is to highlight on such practical aspects of optimization.
This project implements practical solutions for portfolio optimization using Julia1. We will explore various aspects of portfolio design and more importantly, implement these idea-s on a real-world dataset.
Dataset & Folder Setting In this project, we will use a dataset gathered from the NYSE market with stock prices of 699 stocks between 2018 and 2022. To prepare your working environment, please retrieve from Black- board the Jupyter notebook template ftec2101 project 2023.ipynb, a helper function reusablefunc.jl, and the dataset archives ftec project files.zip, ftec project subgroupi.zip (where i 2 {1, …, 5} – de- pending on your assigned subgroup).
As usual, it is a good habit to move the files to a working directory of your choice, and unzip the archives. Your working directory shall contain the following content:
f 用 于 p r o j e c 的t 第 二部 分 2 支 股 6 9 支9 股 包 含前 面 那 㩺
The folders ftec project subgroupi, ftec project files contain essentially the same content of the stock data of 20 stocks and 699 stocks, respectively. The latter contains the complete dataset that includes the former, which will be used in the second part of the project. Furthermore, for each stock, the dataset is split a training dataset and testing dataset, as follows:
2019.8 v2019.10 train
• For compulsory task, * train.csv – stock prices for training, taken from Aug, 2019 to Oct, 2019.
1As an alternative, you are welcomed to use Python with optimization modeling packages supporting SOCP and MI-NLP such as cvxpy. However, you have to notify the instructor about the choice and the plan on how you wish to accomplish the project in the latter case on or before May 1, 2023, i.e., two weeks before the deadline.
每支股的数据集又被分为大产品篾

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
• For compulsory task, * test.csv – stock prices for testing, taken from Oct, 2019 to Dec, 2022.
• For competitive task, * train.csv – stock prices for training, taken from Feb, 2018 to May, 2021.
zo8i.5 wi • For competitive task, * test.csv – stock prices for testing, taken from May, 2021 to Dec, 2022. zozi5 znzio test
1.1 Compulsory Tasks (50%)
Suppose that there are n stocks in the market that can be invested. We begin our study by considering the following simplified version of mean-variance Portfolio Optimization problem2: 阿正硕
r ̄ =E[R(t)], ⇢ =E[(R(t)r ̄)(R (t)r ̄)], R(t)=
such that for any i, j = 1, …, n, it holds
i ti ij t i i j j i
mm 十点, maxi
⇢ n 1 ⇢ n 2
⇢ n n r ̄ n
closing price on day t opening price on day t
a l i p pJ zip iai
Consider the portfolio optimization problem given in (1.1). Answer the following questions:
r1 = 1>⌃1r ̄, r2 = 1>⌃11. 品品
P 组合投资收益 是
min p>⌃p p>r ̄ p2Rn
(1.1) where > 0 is a user-defined parameter (for regulating the risk of the selected portfolio), B > 0 is a fixed
s.t. 1>p = B,
budget, and 1 is an n-dimensional all-one vector. We have defined the covariance matrix and expected return
vector for each stock respectively as:
0B ⇢11 ⇢12 ··· ⇢1n 1C 0B r ̄ 1C
1 ⌃=B ⇢21 ⇢22 ⇢2n C, r ̄=B r ̄2 C @ . … . A @ . A
openingpriceondayt
i.e., R (t) is the return of stock i on day t as they were defined during the lectures. Notice that (1.1) is只a
Theory & Modeling
piF an 珙县州不二
constrained optimization problem, which can be shown to be a convex optimization since ⌃ must be a PSD matrix. Throughout this project, we assume that ⌃ is also non-singular. to
L i p 以 n i i p p i r ai
Task 1: (5%)
变量只有p吗 不用对下档吧 npippiFalipBY对p求一阶导F式式 Fai 㔭自己创建的Lagrangianrunner
化成 古啊 贰 我是不是阶导导错了啊
(a) Derive the KKT conditions for (1.1) and show that the optimal solution for (1.1) is:
后 面T a s k要用这 个 P s T a s k5前 n i E 下 i i i i
1 2Br p?= ⌃1r ̄+ 11,
(b) Define a fixed desired return as Rd. Calculate the range of such that the expected return satisfies
乘 if2 武r 虊
r ̄ p Rd.
2Note that unlike the examples given in the lectures, we do not constraint p _efe
入 口 噵 这 样做对吗 那化完 呢 京欝䲜线7 一
T a s k 5 中要用
amount 乐x mx是3支股in
to be non-negative in this simplified task.
n n rs是 return ihavefixedbugetixnxux io

ˇˇˇˇˇˇˇˇˇˇˇˇˇ
One-sided Risk. The main aim of this project is to extendi
st xitxztxz io
portfolio optimization to cover some realistic aspects of the problem. We first recall the following Markowitz’s mean-variance Portfolio Optimization problem
that we have studied during the class: let 1 denotes the all-one vector: min 1p>⌃p Task6 scoop
s.t. 1>p = B, r ̄>p Rd, p 0. 将⻛险视为回报⻄方差
(1.4) The above portfolio optimization problem (as well as (1.1)) considers the risk of a portfolio as the variance
of the return given by the portfolio. Notice that the variance equally measures the upside risk and downside 3e_
risk . The objective function penalizes any deviation of the selected portfolio from the expected return.
避 任何偏差 最小化 新
This possibly deviate from the practical needs since an upside risk (e.g., the actual return is higher than the expected one) is not harmful. Instead, ideally one may focus on reducing the downside risk only.
The aim of this project is to investigate di↵erent modifications to the portfolio optimization problem that focus on the downside risk. To this end, the first idea we shall implement is to minimize the probability of the event when the actual return is smaller than the expected return, i.e., 实现收益小于预期收益了概产的最小化
where P{A} denotes the probability of event A,
(random) return of n stocks on day t. With a sucient number of historical records for the stocks, the above
x 1 {p>r ̄p>Rt >0}, where {x>0}= 1, ifx>0, Tt=1 0, ifx0.
is the indicator function. Now, complete the following task.
probability can be approximated by
P{p>r ̄ > p>Rt} 最小化这个function
>〇n 实际噬 gt
Rt = [R1(t), R2(t), . . . , Rn(t)] , and Rt 2 R is the actual
Task 2: (5%) 不能
Formulate the portfolio optimization problem to determine p 2 Rn with the following requirements:
• The objective is to minimize the downside risk associated with the new portfolio, i.e.,
品品击19TFRt y代和R要t再改写
function objective
{p (r ̄R)>0} t
3 S t 三只 p i F i 3 R d
Upside risk is the sum of excessive actual return compared to the expected one; downside risk is the sum of insucient
actual return compared to the expected one. Usually, upside risk is not a risk as you actually make more profit than expected; seehttps://en.wikipedia.org/wiki/Upside_risk. 这不应该只是照片一遍吧
用在哪 也没有 constant constant boundedby M OR 或IfThen 啊
这要怎么化MIP形式啊

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
It is required that the expected return is aPbove or equal a given threshold $Rd, i.e.,
constraints
pi也不是 0⻔吧 难道要自己新建个 价值净变化之和EB
The sum of net change in peortfolio value mPust be less than or equal to the budget $B, i.e.,
p r ̄ R .
ni=1 pi  B. Mis pi 0, i = 1, …, n.
You may assume that for anygt = 1,…,T, the quantity p (r ̄ R ) is always bounded by M. The
As we have learnt from the class, the MIP problem can be very challenging to solve when T is large. As an alternative, we approximate the objective function (1.5) with the following ridge function:
The portfolio must be non-negative, i.e.,
formulated problem shall be a mixed-integer program.
max{x,0} = 0, 碮和 in 样吗
mm 十点 mini Rtot
Now, complete the following task.
max{p>r ̄ p>Rt, 0}
if x > 0, if x  0.
Task 3: (5%)
(a) Similar to Task 2, formulate a optimization problem to determine the portfolio p 2 Rn with the
piEB hers30 tl h
• The new portfolio must be non-negative.
(b) Rewrite the above optimization problem as a standard form LP.
following requirements:
• The objective is to minimize the ridge-function risk (1.6) associated with the portfolio.
• It is required that the expected return is above or equal a given threshold as $Rd.
• The sum of net change in portfolio value must be less than or equal to the budget $B. EB
admit a closed form solution. We next focus on solving these portfolio optimization problems numerically on computers an-d evaluate their performance subsequently.
Computational The optimization problems formulated in Task 2 & 3 are MIPs/LPs which do not
Data Preprocessing. The required data – expected return r ̄ , and covariance between stocks ⌃ = [⇢ ] –
can be approximated from historical data as:
1XT ⌘⇣ 1XT ⌘
i T i ij T i T i j T j
R(t) R(t0) R(t) R(t0) , 8i,j=1,…,n. t0=1 t0=1
r ̄ ⇡ R(t), ⇢ ⇡ t=1
ij n⇥n (1.7)

Computer Science Tutoring
Lip npip pTF alip
Accordingto zip二 Accordingto iiaiz.in
substituteup二点into it ai f䲜㽊仙
wehave a 2入1章3 下 ueaenminat.byED iii
Accordingto l vi E吢 i i 下 ai ii下咒1
b 下洪3Rd Rd ip Ra T.im 呮只
叫㠭州一邀不 小谜 测
iiiij ziEYF
心 TE下一岭 iF
ig iiini.sn ID
入a R igo h Tiny y
IDTaskz.mn pEN ti’HimRt o
st 三只Fi3Rd pi
烈PiEB piso in
p ㄒ下一R t 1
i f P T F R t o if pTFRDEO
MG pTFR.DE 忊下一Rt M 1

Task3 a mm 十点maxfi TRt.gs
t.EE pFii3Rd
烈 PiEB piso in n
z.si𤇍maxfi TRt.no
Z30 Z3忭一iRt 五只pi Fit Rd
烈 PiEB piso in n
Programming Help, Add QQ: 749389476
ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ 5 With a slight abPuse of notations, we shall refer the approximated expected return and covariance by the same
symbols r ̄ = 1 T R (t) and ⌃ = [⇢ ] . i T t=1 i ijn⇥n
(a) Inspect the dataset, e.g., by plotting the daily return over time of around 3-4 stocks of your choice.
Remark: The program template has provided the relevant helper codes for this task. croissants
Portfolio Optimization. In the following tasks, you will implement the di↵erent portfolio optimization for- mulations that you have completed in Task 1–3. They will be implemented into Julia and their performances will be evaluated.
In the following tasks, we focus on a small set of n = 20 stocks (from ftec project subgroup i) as our first
exploration:
Task 4: Warmup Exercise (5%)
nnziaoeform
Task 5: Closed Form Solution with Simple Portfolio Optimization (7.5%)
We first implement the closed form solution found in Task 1:
Implement the closed form solution found in Task 1 with the given training data. You may take the parameters TiPm 烈下
B=20,R=1.01 n r ̄,=0.5. d i=1 i
⇢ˆ . Comment on the trends you found using iǜ
Plot the portfolio across di↵erent stocks and compare the portfolio profile with (i) the expected
Comment on the portfolio you found using the above parameters.
returns r ̄ , (ii) the variance of return for
the above parameters. Hint: You may need to scale up/down the expected returns and variances to
make the plots more readable.
Calculate Task 1(b) and try several di↵erent values (at least 2) for the parameter . Comment on its e↵ects on the optimal portfolio.
Try di↵erent values for the desired return Rd, budget B. Comment on their e↵ects on the optimal portfolio.
Suppose the given portfolio is wi = 1, i = 1, …, n. We now implement the two formulations in Tasks 2–3, as well as the original mean-variance Markowitz portfolio optimization.
Task 6: Optimization-based Formulation (17.5%)
(a) Implement an SOCP program for minimizing the risk 1p>⌃p as in (1.4); check out Lecture Note 2
r ̄. tfe.e_no.mn
19 to see how to write the SOCP program. Use the following parameters:
转soon B=20,R =1.01P
You may use the solver ECOS in JuMP for the SOCP.
(b) Implement the mixed-integer program from Task 2 with the following parameters:
B=20,M=40,R =1.01 r ̄. d i=1 i

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
You may use the solver GLPK in JuMP for the MI-LP.
(c) Implement the LP from Task 3 with the following parameters:
B=20,R=1.01Pn r ̄. d i=1 i
You may use the solver GLPK in JuMP for the LP. e
(d) Plot and compare the portfolios found using the approaches from Task 1, 2, and 3. Comment on
the di↵erences between the solutions obtained.
Notice that the plot in part d) of Task 6 may look like:
which shows the portfolio optimized for each stock, compared with the expected return and variance/risk.
Lastly, we shall introduce several metrics for measuring the performance of a portfolio p. Here, these perfor- mance metric shall be calculated from the test dataset with Ttest days of record. We first formally define the downside risk in two di↵erent favors:
Ttest 这边开始有品没太懂 1 X
Amt. of Downside Risk Violation = T
Prob. of Downside Risk Violation = {p r ̄train p Rt > 0}
max{0, p>r ̄train p>Rt > 0}
where r ̄train indicates the average risk vector from the training dataset, i.e., it was simply called r ̄ in the
Ttest 1 XTtest
previous tasks. Another commonly used metric is the Sharpe ratio4 [Fabozzi et al., 2007]:
r ̄> p Sharpe ratio = p test
p> ⌃test p
notice that the expected return r ̄test and covariance ⌃test shall be calculated using similar formula as (1.7) but
with the testing data that are not seen during the portfolio optimization. Notice that if p = 0, then we define
4Assuming that the risk free asset has zero return. 心心⻔
Sharpe ratio = 0. For your convenience, we have prepared a function that are included with the preloaded file reusablefunc.jl and it can be called as sharpe ratio(path, p), with the inputs as

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
• path – the relative path in which the testing data are stored. • p – the portfolio p.
The function will report (i) the Sharpe ratio of the portfolio p, (ii) downside risk violation probability, (iii) the average downside risk violation, (iv) the expected return, (v) the total transaction cost, and (vi) the total
portfolio value.
这边应该不用自己改代码 Task 7: Evaluate the Portfolio Performance on Testing Set (5%) repo里rt写比较的结果就行
Compare the solutions found in Task 5 and 6 under the given parameters, (i) the Sharpe ratio of the TANGO _
portfolio p, (ii) downside risk violation probability, (iii) the average downside risk violation, (iv) the expected return, and (v) the total portfolio value.
For example, you may observe the following output using the helper code provided:
Note that the testing set contains data that have not been seen by the optimization problem. Don’t be surprised if they display worse performance than you expected.
1.2 Competitive Tasks (30%)难
The goal of this competitive task is to implement your own (approximate) solver to the portfolio optimization problem, witehout relying on JuMP and its optimizers su-ch as GLPK, ECOS. To motivate, we observe that while optimization packages such as JuMP are very convenient to use, yet these solvers are limited by their high complexity for large-scale problems when n, T 1.
To prepare for this task, we adopt two modifications to search for a portfolio with the best performance and lowest cost, as follows:
• In Task 3, you have begun with a portfolio optimization problem in the following form (before you transform the problem into a LP):
f1(p)  0, f2(p)  0, 0pi, i=1,…,n,
max{p>r ̄ p>Rt, 0}

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ 8 where f1,f2 are some functions of the portfolio p 2 Rn. A heuristic for solving the above problem is to
consider the following approximation:
min max{p>r ̄p>R,0}+f (p)+道f道(p) n-
p2R t 1 2 t=1
s.t. 0pi 1, i=1,…,n,
for some , > 0. Note we have included an upper bound on each pi.
For your information, this method is called the penalty method which adds constraints to the objective function by imposing a cost to infeasible points [cf. This idea is related to the Big-M simplex method].
For instance, since we desired that f1(p)  0 in the original formulation, the approximation shall impose a positive cost if f1(p) > 0 [recall that > 0]. Moreover, intuitively, increasing (resp. ) ensures that the constraint f1(p)  0 (resp. f2(p)  0) is more strictly enforced.
• An issue with max{x,0} function is that the latter is not di↵erentiable at x = 0. As such, the second modification is to approximate the max function with the Huber function, parameterized by > 0, as:
这块有点晕乎 心怎么突然出来的 2 的 8> > > > > x
and we replace the optimization problem (1.8) by
>:, if0x, <2 h(x)=>x12, ifx>, 0, if x < 0, min h(p>r ̄ p>Rt) + f1(p) + f2(p)
s.t. 0pi 1, i=1,…,n,
Finally, observe that (1.8) is now an optimization problem with a ‘simple’ constraint: X ={p2Rn :1pi 0, i=1,…,n},
where X is a convex set, and the projection into this set can be easily calculated. In other words, with a di↵erentiable and convex f1,f2, it is easy to apply methods such as projected gradient, conditional gradient methods to solve (1.8); see Appendix A. This is the goal of the main task in this section:
Task 8: Customized Solver for Portfolio Optimization (30%)
Using the complete dataset with the training data from n = 699 stocks stored in /ftec project files/, oi
recorded over T = 799 days. Implement a projection-based iterative algorithm to tackle (1.8) with a choice of approximation (e.g., Huber function (1.9)) approximating the downside risk minimization problem in Task 3 (which approximated Task 2). Notice that the budget constraint B and expected return goal Rd are irrelevant in this task as the additive constants in the constraints shall have no e↵ects on (1.8). As a recommendation, you can apply the projected gradient descent method using a constant step size.
While we have provided some suggested values in the helper code.l ,,, as well as the step size, to achieve the best result.
For the iterative algorithm applied, you are required to initialize by p0 = 0 and the algorithm has to run –
You may need to tune the parameters

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ 9
for at least 5000 iterations. You are encouraged to try more than one algorithm (which will be counted towards the ‘innovation’ section in the Report assessment).
Assessment You will receive a maximum of 9% for implementing at least one numerical algorithm (e.g., 画图
projected gradient) correctly, together with (i) plotting the trajectory of the algorithm is show that the 证1.8中递减 评价算法
objective value in (1.8) is decreasing and providing comments on the algorithm(s) implemented, (ii) showing thederivationsonwhytheimplementedalgorithmcanbeusedtosolve/tackle(1.8).算法为什可么以解决 的推
The remainder of your marks will be calculated according to the following formula:
Score = (Score on the Sharpe Ratio, see below) 自己创建峅法重养Task6
+5%⇥ exp ⇣10 · max{0.45, Your Probability of Downside Risk Violation (test data)}⌘ + 3% ⇥ max{0.1, Lowest Amount of Downside Risk Violation (test data)} .
max{0.1, Your Amount of Downside Risk Violation (test data)} where the score on Sharpe Ratio will be calculated as follows:
if Your Sharpe Ratio (testing data) > 0, then 5% ⇥ min{0.01, Your Sharpe Ratio (testing data)} min{0.01, Highest Sharpe Ratio (testing data)}
in class ˇ
Note that this part of the score can be negative if the Sharpe ratio of your portfolio is negative. For example, the lowest amt. of downside risk violation (training data) are calculated as the lowest one among the class of FTEC21015 .
If you have tried more than one algorithm and/or more than one set of parameters, you can select only one set of portfolio for the competition. Please indicate which set of portfolio is selected in your report and include that in the submission of your program files. Moreover, please observe the following rule:
• Your selected algorithm for the competition must be deterministic. In other words, you may not use stochastic algorithm such as stochastic gradient descent (SGD) for the competition. That being said,
otherwise,itis 5%⇥
⇣ ft ⌘ exp ⇣10 · max{0.45, Lowest Probability of Downside Risk Violation (test data)}⌘
exp 10 · max{0.45, Lowest Probability of Downside Risk Violation (training data)} +5%⇥ exp ⇣10 · max{0.45, Your Probability of Downside Risk Violation (training data)}⌘
+ 3% ⇥ max{0.1, Lowest Amount of Downside Risk Violation (training data)} max{0.1, Your Amount of Downside Risk Violation (training data)}
Your Sharpe Ratio (testing data)} ˇˇˇˇˇˇ ˇˇˇˇˇ ˇˇ ˇˇˇ ˇˇˇˇˇˇ ˇ Mˇ ost Negative Shar e Ratio testing data)
• You are not allowed to directly optimize on the testing set data. In other words, your iterative algorithm should not ‘touch’ any data file with the sux test.csv as you are not supposed to see the ‘future’
when investing. Your score in (1.11) will be set to zero if we detect such ‘cheating’ behavior. However,
you can use the function total performance to evaluate your portfolio as many times as you like.
ˇˇˇˇˇˇˇ ˇˇˇˇˇˇˇˇˇˇ ˇˇˇ ˇˇˇˇˇˇˇ ˇˇˇˇˇˇˇ ˇˇˇˇˇˇ ˇˇˇ ˇˇˇˇˇ ˇ
you are still encouraged to try such algorithms as an additional task which may be counted towards the ‘innovation’ section.

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ ˇ
ˇˇ ˇˇˇ ˇˇˇˇ ˇˇˇˇˇ
Report (20%)
You are required to compile a project report with answers to the questions posed in Task 1 to Task 8. You
may structure the report according to the order of the tasks, for instance:
1. Background and Introduction — In this section, you can briefly introduce the problem, e.g., explain- ing the goal of portfolio design, discussing the role of optimization methods in portfolio design.
2. Model and Theory — In this section, you can discuss how the portfolio design problem is modeled as optimization problems. More specifically,
– You shall begin by discussing the formulation (1.1) and then answer the questions in Task 1.
– Next, you can describe the optimization models with transaction costs and then answer Tasks 2 & 3.
3. Experiments — In this section, you describe the experiments conducted to test your formulation, i.e., 描述数据集 描述数据集的元数据
– You shall first describe the dataset by answering Task 4. In addition, it is helpful to describe a few meta-data regarding the dataset, e.g., from when to when the stock price data is collected.何时收集数据来源
描述了种公式的实验结果
– Then, you can describe the experiments for each of the 3 formulations, by answering Tasks 5 & 6. 比较3种公式方法
– Finally, you can compare the formulations by answering Task 7. ˋ 管
4. Competitive Task — In this section, you describe the custom solver you built to solve the large-scale
portfolio design problem, i.e.,
– You shall first describe the approximation technique as laid out in the discussion of (1.8), (1.9).
描述近似技巧 描述迭代算法
– Then, you shall describe the iterative algorithm you have derived in Task 8.
应 用迭 代算 法于完 整的训 练数 据 显 示目 标值 迭 代次 数
– Apply the iterative algorithm on the complete training dataset and show the objective value vs. iteration
算法是否收敛 报告设计的组合投员性能
number. Discuss whether the algorithm converges and report on the p所erformance of the designed portfolio
(e.g., the Sharpe ratio, etc..).
5. Conclusions — In this section, you shall summarize the findings in the project, and discuss various
发现 aspects that can be可improved with the formulation, etc..
Throughout the report, please feel free to write your answer which involves equations (e.g., Task 1-3) on a paper and scan it to your Word/PDF report as a figure. For Task 4 to 8, please include all the ploets and comments as requested. For Task 8, please indicate the required metrics in the scoring formula (1.11) of the selected solution.
The program code has to be submitted separately. However, you are welcomed to use excerpts from the program codes if you find that it is helpful for explaining some of the concepts.
Lastly, you are welcomed to use online resources when preparing the project. However, you must give proper references for every sources that are not your original creation.
Code Help, Add WeChat: cstutorcs
ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
Assessment Here is a breakdown of the assessment metric for the report writing component.
• (10%) Report Writing: A project report shall be readable to a person with knowledge in optimization (e.g., your classmates in FTEC2101/ESTR2520). Make sure that your report is written with clarity, and more importantly, using your own language!
• (10%) Innovation: You can get innovation marks if you include extra experiments, presentations, etc.. that are relevant to the project (with sucient explanations); see Appendix A for some recom- mendations.
1.4 Submission
This is an individual project. While discussions regarding how to solve the problems is encouraged, students should answer the problems on their own (just like your HWs). The deadline of submission is May 15, 2023, 23:59 (HK time). Please submit a esingle zip file with the following content:
• Your Project Report in PDF format.
• Your Program Codes [either in Jupyter notebook (.ipynb), or Julia code (.jl)].
In addition, all project reports shall be submitted to VerieGuide for plagiarism check. (The submission to VeriGuide needs not follow the strict deadline of the main submission, e.g., it can be done within a reasonable amount of time like on or before May 16.)
On the Use of Generative AI Tools
The teaching team of FTEC2101/ESTR2520 is aware of the rapid advances of generative AI tools such as ChatGPT from OpenAI, Sydney from Bing, etc. Below we state our policy on their uses in this project assessment.
In short, you are allowed to use generative AI tools to assist you in this project, provided that you must give explicit acknowledgement to the use of such tools, e.g., you may include a sentence like:
ˇˇˇˇ ˇˇˇˇˇˇˇˇˇ ˇ ˇˇˇˇˇˇˇˇˇˇ ˇˇˇˇˇˇˇˇˇˇˇ ˇˇ ˇ ˇˇˇˇ ˇˇ ˇˇˇˇˇˇ ˇˇˇ ˇˇ ˇ
ˇˇˇ ˇˇˇ ˇˇˇ ˇ ˇ ˇˇ ˇ ˇˇˇˇˇˇˇ ˇˇ ˇ ˇ
The following section has been completed with the aid of ChatGPT.
• DO’s: You may use AI tools such as ChatGPT for polishing your writeups, e.g., to correct grammatical mistakes, typos, or summarizing long/complicated paragraphs, etc. The results are usually quite robust especially for improving the writings from less experienced writers. Of course, you are responsible for the integrity of the edited writing, e.g., check if the AI tools have distorted the meaning of your original writeups or not.
ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ ˇ
Below we list a number of examples of the do’s and don’ts for the FTEC2101/ESTR2520 project:

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ 12
• DON’Ts: You should not ask AI tools such as ChatGPT to formulate optimization problems, solve mathematical questions, or write the programming codes for you. Not only this will spoil the purpose of learning, AI tools do a notoriously bad job for tasks involving facts and mathematical/logical reasoning. Worst still, they tend to produce solutions that sound legit but are completely wrong.
• DON’Ts: You should not ask AI tools such as ChatGPT to write the entire report for you. Likewise, AI tools are notoriously bad at creating (technical) content. They tend to produce writings that sound legit but are completely illogical.
The practical use of generative AI tools is all new to the most of us. We believe that when properly used, they can be helpful in improving students’ overall learning experience. In fact, you are even encouraged to try them out at your leisure time. (P.S. It is important to remind ourselves that without advanced optimization methods, these almost-magical generative AI tools would not even exist!)
Nevertheless, we must emphasize again that you have to provide explicit acknowledgement in your sub- mission if you have used any generative AI tools to assist you in the project.
A Additional Information
Several tips for implementing the convex problems which have been included with the the template program. However, please be reminded that it is not necessary to follow all the tips therein.
Suggestions for Extensions — The below are only suggestions for the extensions. You are more than welcomed to try out new ideas in your project.
• Formulation Aspect – For task 8, another model to approximate the max function is to use the sigmoid function, parameterized by ↵ > 0, , as:
T t,↵,(p) where
t,↵,(p)= 1+exp{↵p>(r ̄Rt)+}. (1.12)
which yields a better approximation than max{x, 0} to the desired 0-1 indicator function.
• Algorithm Aspect – For Task 8, with the constraint structure given, the recommended algorithms are projected gradient descent (PGD) method and conditional gradient (CG) method, which are described as follows. For solving a general optimization:
min F(x) s.t. li  xi  ui, i = 1,…,n. (1.13) x2Rn
Let X = {x 2 Rn : li  xi  ui, i = 1,…,n}, these algorithms can be described as
Input: x(0) 2Rn withli x(0) ui foralli,con- Input: x(0) 2 Rn with li  x(0)  ui for all i, ii
stant step size > 0, max. iteration number Kmax. For k = 0,…,Kmax
x(k+1) = ProjX x(k) rF (x(k)) End For
PGD Method
max. iteration number Kmax. For k = 0,…,Kmax
a(k) = arg mina2X a>rF (x(k)) x(k+1) = (1 2 )x(k) + 2 a(k)
k+1 k+1 End For CG Method

ˇˇˇˇˇˇˇ ˇˇ ˇˇˇˇ
Moreover, the projection/CG operators can be easily compu8ted: for any g 2 Rn, we have
><>: g i , i f g i 2 [ l i , u i ] , gPG = ProjX(g), where [gPG]i = li, if gi < li, ui, ifgi>ui. gCG = arg min a>g, where [gCG]i = (ui, if gi