In: Statistics and Probability
Q3. Consider the matrix A . Use R statistical software to determine the eigenvalues and normalized eigenvectors of A, trace of A, determinant of A, and inverse of A. Also determine the eigenvalues and normalized eigenvectors of A-1. Your answer should include your R code (annotated with comments) and a hand-written or typed summary of the answers from the R output.
R code:
A=matrix(c(2,4,1,4,3,1,3,1,1),nrow=3,ncol=3)
A
M=eigen(A)
M$values #eigenvalue
M$vectors #eigenvectors
prod(M$values)# determinant of A
#(Note: Alternative R code for determinant:"det(A)")
solve(A)#inverse of A
U=eigen(solve(A))
U$values #eigenvalue
U$vectors #eigenvectors
Output:
> A=matrix(c(2,4,1,4,3,1,3,1,1),nrow=3,ncol=3)
> A
[,1] [,2] [,3]
[1,] 2 4 3
[2,] 4 3 1
[3,] 1 1 1
> M=eigen(A)
> M$values #eigenvalue
[1] 7.1595227 -1.5968621 0.4373393
> M$vectors #eigenvectors
[,1] [,2] [,3]
[1,] -0.6750923 -0.75817748 0.2259423
[2,] -0.7029896 0.65073427 -0.6394382
[3,] -0.2237319 0.04137425 0.7348938
> prod(M$values)# determinant of A
[1] -5
> #(Note: Alternative R code for determinant:"det(A)")
> solve(A)#inverse of A
[,1] [,2] [,3]
[1,] -0.4 0.2 1
[2,] 0.6 0.2 -2
[3,] -0.2 -0.4 2
> U=eigen(solve(A))
> U$values #eigenvalue
[1] 2.2865541 -0.6262282 0.1396741
> U$vectors #eigenvectors
[,1] [,2] [,3]
[1,] 0.2259423 -0.75817748 0.6750923
[2,] -0.6394382 0.65073427 0.7029896
[3,] 0.7348938 0.04137425 0.2237319