3.10 Problems: Matrix Algebra Review
Exercise 3.1 Use R to answer the following questions.
- Create the following matrices and vectors A=[147248613],B=[440591225],x=[123],y=[527]
- Compute the transposes of the above matrices and vectors.
- Compute A+B,A−B,2A,Ax,AB,y′Ax
Exercise 3.2 Consider the system of linear equations
x+y=12x+4y=2
- Plot the two lines and note the solution to the system of equations. Hint: you can use the R functions
abline()
orcurve()
to plot the lines. - Write the system in matrix notation as Az=b and solve for z by computing z=A−1b.
Exercise 3.3 Consider creating an equally weighted portfolio of three assets denoted
A, B, and C. Assume the following information
μ=[0.010.040.02],Σ=[0.100.300.100.300.15−0.200.10−0.200.08].
Use R to answer the following questions.
- Create the vector of portfolio weights.
- Compute the expected return on the portfolio.
- Compute the variance and standard deviation of the portfolio.
Exercise 3.4 Let Ri be a random variable denoting the simple return on asset
i(i=1,…,N) with E[Ri]=μi, var(Ri)=σ2i
and cov(Ri,Rj)=σij. Define the N×1
vectors R=(R1,…,RN)′, μ=(μ1,…,μN)′,
x=(x1,…,xN)′, y=(y1,…,yN)′,
and 1=(1,…,1)′, and the N×N covariance
matrix
Σ=(σ21σ12⋯σ1Nσ12σ22⋯σ2N⋮⋮⋱⋮σ1Nσ2N⋯σ2N).
The vectors x and y contain portfolio weights
(investment shares) that sum to one. Using simple matrix algebra,
answer the following questions.
- For the portfolios defined by the vectors x and y give the matrix algebra expressions for the portfolio returns Rp,x and Rp,y and the portfolio expected returns μp,x and μp,y.
- For the portfolios defined by the vectors x and y give the matrix algebra expressions for the constraint that the portfolio weights sum to one.
- For the portfolios defined by the vectors x and y give the matrix algebra expressions for the portfolio variances σ2p,x and σ2p,y, and the covariance between Rp,x and Rp,y.
- In the expression for the portfolio variance σ2p,x, how many variance terms are there? How many unique covariance terms are there?