Assignment MEF 1 2018 Solution
Assignment MEF 1 2018 Solution
Out: 18/09/2018
In: 9/11/2018
1
Exercise 1
Note: Please do this exercise by hand and using Matlab. Please enclose a printout of your code.
2 0 1 1
−2 2 1 −1
Consider a matrix A =
.
0 0 3 1
0 −2 −1 3
(a) Compute the determinant, the transpose, the trace, the null space, the inverse matrix and the adjoint matrix
of A.
(b) Find the eigenvalues and eigenvectors of A. Can you decompose A as CΛC −1 , where C is the matrix of
eigenvectors and Λ is the matrix with the eigenvalues of A on its diagonal? If yes, compute the decomposi-
tion. If no, explain why.
(c) Check the definiteness of A using two approaches: by computing the minors and by using the eigenvalue
method.
(d) Find a solution to the system of linear equations Ax = b, where b = (1, 1, 1, 1)0 .
Solution 1
(a)
2−λ 0 1 1
−2 2−λ 1 −1
|A − λI| =
0 0 3−λ 1
0 −2 −1 3−λ
2−λ 0 1 2−λ 0 1
= (−1)3+3 (3 − λ) −2 2−λ −1 + (−1)3+4 −2 2−λ 1
0 −2 3−λ 0 −2 −1
First eigenvector:
−1
1
(A − 2I) ∗ x1 = 0 ⇒ x1 =
−1
1
Second eigenvector:
1
−1
(A − 4I) ∗ x2 = 0 ⇒ x1 =
1
1
We have 2 eigenvectors only. Since we would need 4, we cannot decompose the matrix A without making
any further assumptions about the eigenvectors (e.g. like we did in class).
2
(b) E.g.
2 0 1 1 1 0 0 0
−2 2 1 −1 0 1 0 0 row2 + row1 = row20
AA−1 =I⇒
0
0 3 1 0 0 1 0
0 −2 −1 3 0 0 0 1
2 0 1 1 1 0 0 0
0 2 2 0 1 1 0 0
⇔
0
0 3 1 0 0 1 0
0 −2 −1 3 0 0 0 1 row4 + row2 = row40
6 0 0 2 3 0 −1 0
4 × row1 − row4 = row10
0 6 0 −2 3 3 −2 0
⇔
0 0 3
4 × row2 + row4 = row20
1 0 0 1 0
8 × row3 − row4 = row30
0 0 0 8 3 3 −1 3
1
= row10
24 0 0 0 9 −3 −3 −3 row1 × 24
0 24 0 0 15 15 −9 3 row2 × 24 = row20
1
⇔
= row30
1
0 0 24 0 −3 −3 9 −3 row3 × 24
0 0 0 8 3 3 −1 3 row4 × 8 = row40
1
1 0 0 0 0.375 −0.125 −0.125 −0.125
0 1 0 0 0.625 0.625 −0.375 0.125
⇔
0 0 1 0 −0.125 −0.125 0.375 −0.125
0 0 0 1 0.375 0.375 −0.125 0.375
(c) A is not symmetric, so we cannot apply the standard rules we developed in class to determine its definiteness.
You could have also tried to transform it into a combination of symmetric matrices.
3
1
1
(d) We have a system of linear equations Ax = b where b =
.
1
1
2 0 1 1 1
−2 2 1 −1 1 row2 + row1 = row20
Ax = b ⇒
0
0 3 1 1
0 −2 −1 3 1
2 0 1 1 1
0 2 2 0 2
⇔
0
0 3 1 1
0 −2 −1 3 1 row4 + row2 = row40
1
= row10
24 0 0 0 0 row1 × 24
0 24 0 0 24 row2 × 24 = row20
1
⇔
= row30
1
0 0 24 0 0 row3 × 24
0 0 0 8 8 row4 × 8 = row40
1
1 0 0 0 0 0
0 1 0 0 1 1
⇔
0 0
⇒ x = .
1 0 0 0
0 0 0 1 1 1
Exercise 2
1. Are the following statements true or false? In each case, justify your answer.
(A ⇔ B) ∧ (B ⇔ C) (0.1)
(A ⇔ C) (0.2)
4
[5.] Consider a square matrix A. The eigenvalues of A are the same as the eigenvalues of kA for any
positive constant k ∈ R.
[6.] If A and B are symmetric n × n matrices, then AB must be symmetric as well.
[7.] If a function f is strictly concave, then it is also strictly quasi-concave.
[8.] The set {(x, y) ∈ R2 : x + y = 1} is closed.
[9.] If a function f (x) is continuous at a point x = x0 then it is also differentiable at x = x0 .
[10.] If the null space of A is spanned by the the zero vector, then A is invertible.
[1.] Z
u0 (x) ln u (x) dx,
[2.]
ZT
∂
V (s, r), where V (s, r) = y(t)e−r(t−s) dt,
∂s
s
[3.]
lim [ln(1 + x) ln(ex − 1)] .
x→0
3. For n ∈ N let Z 1
In := (1 − x2 )n dx
−1
2n
Show that In = In−1 and then compute I5 .
2n + 1
Hint: use mathematical induction.
Solution 2
(a) [1.] False.
[2.] False.
[3.] True.
[4.] True.
[5.] False.
[6.] False.
[7.] True.
[8.] True.
[9.] False.
[10.] True.
5
(b) [1.] The considered integral is indefinite, because there are no integration bounds given. Let’s perform the
following computations:
Z Z
0 1
u (x) ln u (x) dx = ln y dy Define y = u (x) ⇒ dx = 0 dy
u (x)
Z
= zez dz Define z = ln (y) ⇒ dy = ez dx
Z
= ze − ez dz
z
Integration by parts
RT
[2.] ∂
∂s V (s, r) = ry(t)e−r(t−s) dt + 0 − y(s) = −y(s) + rV (s; r)
s
lim ln(1+x)
x = 1 (l0 Hopital)
x→0
x ex 2 x x 2 x
lim x ln(ex − 1) = lim ln(e 1 −1) = lim ex −1
−1 = lim −x e
ex −1 = lim
2xe +x
−ex
e
= 0 (l0 Hopital)
x→0 x→0 x x→0 x2 x→0 x→0
x
⇒ lim ln(1 + x) ln(e − 1) = 1 × 0 = 0
x→0
4
(c) Let us prove this statement by induction. First of all, we compute I0 = 2 and I1 = 3, proving that the
statement is true for n = 1.
Second, we assume that the statement is true for n = k − 1 and prove it for n = k.
Let us use the change of varialbe x = cos t:
Z 1
Ik = (1 − x2 )k dx
−1
Z0
= (1 − cos2 t)k (− sin t)dt
π
Z π
=− (sin2 t)k (sin t)dt
0
Z π
=− (sin t)2k (sin t)dt
0
π
Z π
2k
= cos t(sin t) − 2k cos2 t(sin t)(2k−1) dt
0 0
Z π
= −2k cos t(sin t)(2k−1) dt
2
Z0 π
= −2k (1 − sin2 t)(sin t)(2k−1) dt
0
Z π
= 2k (sin2 t − 1)(sin t)(2k−1) dt
0
Z π
= 2k ((sin t)(2k) sin t − (sin t)(2k) sin−1 t)dt
0
Z π Z π
(2k) (2k) −1
= 2k (sin t) sin tdt − (sin t) sin tdt
0 0
= 2k(−Ik − (−Ik−1 ))
6
2n
Therefore, we have In = 2n(In−1 − In ) ⇔ In = In−1 .
2n + 1
2·5 25 · 5! 25 · 5 · 4 · 3 · 2 29 512
I5 = I4 = P I0 = ·2= =
2·5+1 i=1 5(2 · i + 1) 3 · 5 · 7 · 9 · 11 7 · 9 · 11 693
Exercise 3
You are an asset manager at the investment firm Bridgeriver. Your client wants you to do some asset allocation.
He considers investing in three different stocks. You have done some preliminary analysis and have determined
that the payoffs of the stocks in three possible scenarios can be represented by a matrix A:
5 M 1.5
A= 1 5 1.5 ,
1.5 1.5 4.5
where each column corresponds to a different asset and each row is a different scenario. Your client wants you to
determine the allocation in each asset class, denoted θ ∈ R3 , such that he can obtain his target payoff b. In other
words, you want to determine θ such that Aθ = b.
(a) Compute det(A). For which values of M can you find a unique allocation for any b?
Assume now that M = 1.
(b) Does A satisfy any of the following properties: symmetric, idempotent, orthogonal?
(c) Show that the characteristic polynomial of A may be written in the form:
(f) Find the optimal portfolio allocation for b = [b1 , b2 , b3 ]0 , i.e. θ = A−1 b. Hint: use the results of the previous
point together with the properties of an orthogonal matrix to simplify your calculations when computing
A−1 .
Assume now that you have updated your beliefs about the payoff matrix and that it is now equal to
6 −2 −1
A = −2 6 −1 .
−1 −1 1/2
Solution 3
(a) det(A) = 369/4 − 9/4M . There exists a unique allocation when A is invertible, that is when M 6= 41.
(b) A is symmetric, but not orthogonal nor idempotent.
(c) Direct computation gives p(λ) = −λ3 + (29 ∗ λ2 )/2 − (129 ∗ λ)/2 + 90, it suffices to check that the roots of
this polynomial are indeed 3, 4 and 7.5.
7
(d) Eigenvalue criterion gives directly that A is positive definite.
(e) The matrices correspond to the spectral decomposition, with S the matrix of eigenvectors and D the matrix
with eigenvalues on diagonal. The normalized eigenvectors (needed to get an orthogonal matrix) are:
• for λ = 3 we reduce the columns of (A − 3I|0) which gives
√1
1 0 1/2 (
x1 + 21 x3 = 0 √16
0 1 1/2 ⇒ ⇒ this gives ⇒ v̂1 = 6
x2 − 12 x3 = 0
0 0 0 − √26
• for λ = 4 we get
√1
2
√1
2
0
• for λ = 7.5 we get
√1
√13
3
√1
3
Using spectral theorem for symmetric matrices we have D = S −1 AS, where S is a matrix of eigenvectors
and D is a matrix with eigenvalues on the diagonal:
√ √ √
6 2 3
6
√ 2
√ √ 3 3 0 0
S = 66 − 22 √33 , D = 0 4 0 .
√
− 6 0 3 0 0 7.5
3 3
− 41
6 −2 −1 8 0 1 1
−2 6 −1 8 ∼ 1 0 − 14 1 .
−1 −1 1/2 N 0 0 0 N +4
Thus for N = −4 we have that rank(A) = rank(A|b) and for N 6= 4 (infinitely many allocations) we have
that rank(A) 6= rank(A|b) (no allocation possible).
Exercise 4
The objective of this exercise is to investigate several statistical properties of financial data. Start by extracting
prices for three individual stocks and three stock indices of your choice. Download also your proxy of choice
for the risk-free rate, e.g. the 3 month T-Bill. Download your data at dail frequency for each time series, e.g.
you can use Yahoo Finance/ Google Finance or access Datastream in CEDIF. Select the most recent 10 years of
data available (i.e. that ends in September 2018) and check that the data series line up in time. Don’t forget to
transform your risk-free rate so that it is expressed on the daily level.
(a) Compute simple returns for all of your time series, i.e. Rt = (Pt − Pt−1 )/Pt−1 .
8
(b) Describe your data. Plot the time series of one of the stocks and one of your indices for both prices and
returns, clearly indicating the axes, the starting date and the end date.
(c) Compute the sample mean, median, standard deviation, autocorrelations up to 10 lags, skewness, kurtosis,
Sharpe ratio (i.e. mean to standard deviation), minimum and maximum for all the time series. Comment
on your results. What are the differences between stock-related moments and index-related ones?
(d) Compute the variance-covariance and correlation matrices of your time series. Can you notice any patterns
in the correlation matrix?
(e) Suppose that you are an investor you would like to invest your wealth in a portfolio composed of stock and
indices that you chose. For this purpose, you use the mean-variance criterion, defined as
λ 2
max µp − σ , µp = φ0 µ + (1 − 10 φ)Rf , σp2 = φ0 Σφ,
φ 2 p
where µp and σp2 are the expected portfolio return and variance of the portfolio return, respectively. Note
that φ, µ are vectors of size 6 × 1 and Σ is a matrix of size 6 × 6. The weights φ are unconstrained and the
weight on the risk-free asset is given by 1 − 10 φ. Rf is the average risk-free rate over the sample period.
1. Give the expression for the optimal portfolio weights. (Hint: compute the first-order derivative of the
0
mean-variance criterion with respect to φ. Remember that d(xdxΣx) = 2Σx.)
2. Assume that expected returns are given by sample means and that the matrix Σ is given by the sample
variance-covariance matrix (you already computed them before). Compute the optimal weight vector
φ∗ for λ = 1, 6, 12. Comment on your results.
Solution 4
The solution depends on the stocks that you picked and your interpretations.
Bonus exercise 1
Consider the following multiple linear regression model:
Y = X1 β1 + X2 β2 + u (0.3)
where β1 and β2 are k1 ×1 and k2 ×1 dimensional vectors, respectively. The matrix X1 is of size n × k1 and the ma-
trix X2 is of size n × k2 , with k1 + k2 = k, Rank(X1 ) = k1 Rank(X2 ) = k2 and Rank(X) = Rank ([X1 X2 ]) = k.
Ỹ = X̃2 β2 + ũ (0.4)
for some vector Ỹ , matrix X̃2 , and vector ũ. Specify Ỹ , X̃2 , and ũ.
(d) You are now asked to estimate the ordinary least squares estimator of β2 , denoted β̂2,OLS . To do so, you must
find a β2 which minimizes the squared residuals in (0.4). In other words, you must solve the following system:
2 2
arg min kũk . Recall that for a given matricex A, B and x, one obtains ∂x ∂
kA − Bxk = −2B 0 (A − Bx).
β2
9
1. Express β̂2,OLS in terms of Ỹ and X̃2 and simplify the expressions.
2. Express β̂2,OLS in terms of Y , X2 , and M1 and simplify the expressions.
2 2
(MX1 ) = In − X1 (X10 X1 )−1 X10
2
= In2 − 2In X1 (X10 X1 )−1 X10 + X1 (X10 X1 )−1 X10
= In − 2In X1 (X10 X1 )−1 X10 + X1 (X10 X1 )−1 X10 X1 (X10 X1 )−1 X10
Ỹ = X̃2 β2 + ũ
MX1 = orthogonal projection matrix.
10
∂ 2
Ỹ − X̃2 β̂2,OLS =0
∂β2 In
−1
β̂2,OLS = (X20 MX1 X2 ) X20 MX1 Y
11