SOCR ≫ DSPA ≫ Topics ≫

1 How is Matrix multiplication defined?

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.

2 Scalar vs. Matrix Multiplication

Demonstrate the differences between the scalar multiplication (\(*\)) and matrix multiplication (\(%*%\)) for numbers, vectors and matrices (second-order tensors).

3 Matrix Equations

Write a simple matrix solver (\(b = Ax\), i.e., \(x = A^{-1}b\)) and validate its accuracy using the 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}\]

4 Least Square Estimation

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.

5 Matrix manipulation

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.

6 Sample Statistics

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.

7 Eigenvalues and Eigenvectors

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).

SOCR Resource Visitor number Dinov Email