Application Exercise
- Open Rstudio Server Pro
- Create a new project
- Click File > New File > R Markdown
- Delete everything except for
---
title: "Untitled"
output: html_document
---
- Give your work a sensible title
- When you’ve finished, upload the .html file to Canvas
- In R, find a design matrix
X where it is not possible to calculate \(\hat\beta\)
solve(t(X) %*% X) %*% t(X) %*% y
- Calculate the determinant of the following matrices in R using the
det() function:
\[\mathbf{A} = \begin{bmatrix} 1 & 2 \\ 4 & 5 \end{bmatrix}\]
\[\mathbf{B} = \begin{bmatrix} 1 & 2 & 3 \\ 3 & 6 & 9 \\ 2 & 5 & 7\end{bmatrix}\] * Are these both invertible?
- Find \(\hat\beta\) that minimizes this:
\[(\mathbf{y}-\mathbf{X}\beta)^T(\mathbf{y}-\mathbf{X}\beta)+\lambda\beta^T\beta\]