辅导案例-MAFS5310

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
Homework 2
MAFS5310 - Portfolio Optimization with R
You should prepare your solution in R Markdown and submit the generated .html or .pdf file. Report all
the steps neatly and also provide the R code snippet.
(Q) We consider the upper bounded Markowitz’s mean-variance portfolio (MVP), where we aim to find a
trade-off between the expected return w>µ and the risk of the portfolio measured by the variance w>Σw:
maximize
w
w>µ− λw>Σw
subject to 0 ≤ w ≤ u · 1, 1>w = 1,
where w ∈ Rn,µ ∈ Rn,Σ ∈ Rn×n, w>1 = 1 is the capital budget constraint, λ is a parameter that
controls how risk-averse the investor is, and u · 1 ∈ Rn+ puts an upper bound on the desired weights. The
above optimization problem has one variable, i.e., w ∈ Rn and two hyper-parameters, i.,e., λ ≥ 0 and
u. The choice of hyper-parameters play a crucial role in the overall performance of portfolio optimization
algorithm. For u = 1n1 it becomes the uniform portfolio, and for u = ∞ it is the trivial MVP. For
sufficiently large λ, the above problem becomes the global minimum variance portfolio and for λ = 0 it
is the global maximum return portfolio. A universal rule for choosing hyper-parameters is not available,
as choices are specific to the individual datasets, leading to cross-validation methods. The aim of this
assignment is to help you to understand the intricacies of parameter selection and their effect on the final
performance of a portfolio optimization algorithm.
Use the datasets available in the package ”portfolioBacktest” and perform the following tasks.
• Consider datasets: dataset10[[1]] to dataset10[[5]]. The setting of the experiment is as follows:
– You have to use dataset10[[1]] to dataset10[[5]]..
– Chose a set of L = 50 different values of hyperparameters, {λi, ui} for i = 1, 2, . . . , L.
– and do the following
(a) For d=dataset10[[1]] to dataset10[[5]].
(b) For i = 1 : L
(c) Use hyper-parameters: ui, λi, and
(d) compute w[d, i] by solving the above optimization problem.
∗ Optimal weight vector for the d dataset using the ith hyper-parmeter.
(e) Compute the Sharpe ratio (SR) S[d, i]
• After completing the steps in (a) to (e) above. Report the hyper-parameter values and the corre-
sponding Sharpe ratio in a tabular form. There will be a total of 5 such tables. Highlight the set of
hyper-parameters which yields the best Sharpe ratio and the worst Sharpe ratio values.
• If you choose the hyperparameters that give maximum SR on, say, the first dataset, is that maintained
on the other datasets?
• How should you choose the best hyper-parameters overall? Explain and then make your final choice.
• How do these experiments fit with what you learned in the lecture of backtesting?
1

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468