This set of exercises will help you to learn and test your skill in matrix operations, starting with basic ones like scalar multiplication all the way through eigenvalue and eigenvectors. Before proceeding, it might be helpful to look over the help pages for the
crossprod functions. If you want further documentation also consider chapter 5.7 from “An Introduction to R”.
Answers to the exercises are available here.
If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment.
A=matrix(c(2,0,1,3), ncol=2) and
a) Find A + B
b) Find A – B
Scalar multiplication. Find the solution for aA where
a=3 and A is the same as in the previous question.
Using the the
diag function build a diagonal matrix of size 4 with the following values in the diagonal 4,1,2,3.
Find the solution for Ab, where A is the same as in the previous question and
Find the solution for AB, where B is the same as in question 1.
Find the transpose matrix of A.
Find the inverse matrix of A.
Find the value of x on Ax=b.
Using the function
eigen find the eigenvalue for A.
Find the eigenvalues and eigenvectors of A’A . Hint: Use
crossprod to compute A’A .