3.10 Problems: Matrix Algebra Review

Exercise 3.1 Use R to answer the following questions.
  1. Create the following matrices and vectors A=[147248613],B=[440591225],x=[123],y=[527]
  2. Compute the transposes of the above matrices and vectors.
  3. Compute A+B,AB,2A,Ax,AB,yAx
Exercise 3.2 Consider the system of linear equations x+y=12x+4y=2
  1. Plot the two lines and note the solution to the system of equations. Hint: you can use the R functions abline() or curve() to plot the lines.
  2. Write the system in matrix notation as Az=b and solve for z by computing z=A1b.
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.150.200.100.200.08]. Use R to answer the following questions.
  1. Create the vector of portfolio weights.
  2. Compute the expected return on the portfolio.
  3. 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.
  1. 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.
  2. 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.
  3. 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.
  4. In the expression for the portfolio variance σ2p,x, how many variance terms are there? How many unique covariance terms are there?