SOCR ≫ | DSPA ≫ | Topics ≫ |
Validate that \((A_{k,n}\times B_{n,m})^T = (B^T_{m,n})\times (A^T_{n,k})\) using both - first principles math as well as using internal R
funcitons.
Demonstrate the differences between the scalar multiplication (\(*\)) and matrix multiplication (\(%*%\)) for numbers, vectors and matrices (second-order tensors).
R
command solve(A,b)
. Then, solve this system of equations:
\[\begin{align}
2a -b+2c &= 5\\
-a - 2b+c &= 3\\
a +b -c &= 2
\end{align}\]
Use the SOCR Knee Pain dataset, extract the RB = Right-Back
locations \((x,y)\). Fit in a linear model for vertical location (\(y\)) in terms of the horizontal location (\(x\)). Display the linear model on top of the scatter plot of the paired data. Comment on the model you obtain.
Create a matrix \(A\) with elements seq(1, 15, length = 6)
and argument nrow = 3
, add a row to this matrix; add two columns to A to obtain a matrix \(C_{4,4}\), then generate a diagonal matrix \(D\) with \(dim = 4\) and elements rnorm(4)
. Apply element wise addition, subtraction, multiplication and division to \(C\) and \(D\); apply matrix multiplication to \(D\) and \(C\); obtain the inverse of \(C\) and compare it with a call to ginv
.
Use the SOCR Data Iris Sepal Petal Classes and extract the rows of setosa
flowers. Compute the sample mean and variance of each variables; then calculate sample covariance and correlation between sepal width and sepal height.
Generate a random matrix A = matrix(runif(9),nrow = 3)
and compute the eigenvalues and eigenvectors for \(A\). Then verify this equation \(A*v = \lambda v\) for each pair of eigenvalue \(\lambda\) and eigenvector \(v\). (Use random seed of 2017).