MATH2070/2970: Optimisation and Financial Mathematics
Optimisation and Financial Mathematics
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MATH2070/2970: Optimisation and Financial Mathematics
• Please note that the due date is different to what was written in the unit outline. This
project is now due at a later date, 11th November.
• This is mostly a computational project so you must submit all computer programs with
your project formulations, descriptions and outputs. Assessment will be based on: accuracy,
programming and presentation.
MATH2070: Do all questions except Question 6.
MATH2970: Do all questions.
Please submit your jupyter notebook (“.ipynb” extension) and a single pdf file (“.pdf”
extension). Your jupyter notebook should be commented to aid understanding and ease
of following your code. Your pdf file should contain your analysis of the results and any
mathematical computations performed.
• The deadline is a hard deadline in the sense that in case of a late submission for each day (up
to maximum 10 days) you will be deducted 5% of the total marks. This is non-negotiable,
so make sure you submit in time; a submission on Friday the 12th at 12:00am will incur
an automatic deduction of 5%. It is your responsibility to check that your submission
was successful.
The Scenario: Alon Nusk has just inherited $1,000,000 and wishes to invest this sum in the five
funds listed below:
Fund Code Return (µ) Risk (σ)
P1 TSLA 0.065 0.038
P2 AMZN 0.070 0.018
P3 AAPL 0.045 0.026
P4 GOOG 0.115 0.036
P5 CSCO 0.025 0.024
Funds P1 and P3 have a negative correlation coefficient −0.35, and funds P2 and P5 have a positive
correlation coefficient +0.60. All other pairs of funds are uncorrelated. There are no restrictions on
short selling and Nusk has a risk aversion parameter measured to be t = 0.005 units.
1. Long or Short:
(a) Import the dataset “Project returns.csv” which contains the returns of 5 funds. Make a
qq-plot for each fund to check the normality assumption of the returns. Estimate the mean
vector and covariance matrix of the returns and verify that it is of the following form:
µ =
0.065
0.070
0.045
0.115
0.025
, S =
0.0014 0 −0.0003 0 0
0 0.0003 0 0 0.0003
−0.0003 0 0.0007 0 0
0 0 0 0.0013 0
0 0.0003 0 0 0.0006
(b) Determine which risk-averse investors (in terms of the values of t) short sell in this market
and which funds they short sell. Are there any funds that no-one will short sell or that
everyone will short sell?
2. Nusk’s Optimal Portfolio: Carry out the following computational tasks for Nusk’s optimal
portfolio P ∗.
(a) Obtain the optimal proportion and dollar investment in each of the five funds. Give the
expected return and risk of P ∗.
(b) Obtain the µσ-plane graphical representation and include (all on the same graph):
(i) The five investment funds.
(ii) The Minimum Variance Frontier. Use a t-range |t| ≤ 0.02 for your display.
(iii) The minimum risk portfolio.
(iv) 1000 random feasible portfolios satisfying |xi| ≤ 2.5 (for each of the 5 funds) and
σi ≤ 0.05 for i = 1, . . . , 1000.
(v) Nusk’s indifference curve and optimal portfolio P ∗.
3. Adding a Riskless Cash Fund: Suppose now that a riskless cash fund P0 is also available to
invest in. The risk free rate is 0.04 for both lending and borrowing.
(a) Obtain the new optimal allocation of Nusk’s inheritance to the (now) six funds. Is it a
lending portfolio or a borrowing portfolio?
(b) Describe in detail the Capital Market Line and the tangency portfolio.
2
4. The Capital Market Line:
(a) Make a new µσ-plane graph showing the riskless cash fund P0, the tangency portfolio,
Nusk’s new optimal portfolio and the Capital Market Line relative to the risky efficient
frontier.
(b) If the five original funds have a net worth of $100 million, estimate (to the nearest $0.1
million) the total value of each fund.
5. The Security Market Line: Compute the β’s of all relevant funds and assets in this project
and clearly display them on the Security Market Line. Comment on the result.
6. The Random Walker (Advanced): In 2021, there is an asset on the market called “Before
Pay” abbreviated as BPT. After a careful analysis, researchers discovered that the value of BPT
has the following dynamics:
Stk = Stk−1 + µStk−1∆t+ σStk−1
√
∆tξ ,
where ξ ∼ N(0, 1) is the component which generates the randomness, and tk = k + ∆t.
(a) Suppose that µ = 1, σ =
√
2 and the current price of BPT is S0 = 5. Generate M = 2000
sample paths of the process S up to the terminal time T = 1 with increments of 0.001, i.e.
step size ∆t = 0.001 and time steps tk = k∆t for k = 0, 1, 2, . . . , 1000.
Plot the ensemble average of S at each time point within the time interval [0, 1]. An
ensemble average is the average taken over all trajectories under consideration at any given
time. For instance, denote the ith sample path by Si = (Sitk)
N
k=0 := (S
i
t0 , S
i
t1 , S
i
t2 , · · · , SitN ),
where tN = 1; the ensemble average at time tk is given by
〈Stk〉 =
1
M
M∑
i=1
Sitk .
Compare the trajectory of the ensemble average to the solution of the differential equation
dyt
dt
= µyt, with initial condition y0 = 5.
What do you observe?
(b) As in the above, generate 5000 sample paths within the interval [0, 1] and plot histograms
of Stk for k = 5, 50, 200. Limit the range of the histogram to [0,50]. In order to be used
as a comparison in part (d), you may plot the histograms using the type “step” and use
large number of bins, say 1000.
(c) Consider the PDE
∂p(x, t)
∂t
=
∂p(x, t)
∂x
+
∂2p(x, t)
∂x2
. (1)
Show that
p(x, t) =
1
2x
√
pit
exp
{
−(lnx− lnS0)
2
4t
}
(2)
is a solution to the above PDE in (1).
(d) Plot p(x, t) at times t = tk for k = 5, 50, 200, for x ∈ [0, 50], compare p(x, tk) to the
histograms in part (b). What do you observe? What can so you say about the relationship
between St and p(x, t)?