Section 18 Matrix Operation: Mathematical
18.1 Matrix operation
Function | Explanation | Example..x.is.square.matrix. |
---|---|---|
t |
Transpose | t(x) |
diag |
Diagonal | diag(x) |
%*% |
Inner (dot) product of two vectors t(x) and y , and conventional matrix multiplication |
x %*% y |
%o% |
Outer product of two vectors x and t(y) |
x %o% y |
crossprod |
Cross products t(x) and y |
crossprod(x,y) |
tcrossprod |
Cross products x and t(y) |
tcrossprod(x,y) |
det |
Determinant | det(x) |
solve |
Inverse | solve(x) |
eigen |
Eigenvalues and eigenvectors | eigen(x) |
svd |
Singular value decomposition | svd(x) |
qr |
QR decomposition | qr(x) |
chol |
Choleski decomposition | chol(x) |