rewriting reg analysis
This commit is contained in:
@@ -938,18 +938,22 @@ plt.show()
|
||||
!split
|
||||
===== The singular value decompostion =====
|
||||
!bblock
|
||||
How can we use the singular value decomposition to find the parameters $\beta_j$? More details will come. We first note that a general $m\times n$ matrix $\hat{A}$ can be written in terms of a diagonal matrix $\hat{\Sigma}$ of dimensionality $n\times n$ and two orthognal matrices $\hat{U}$ and $\hat{V}$, where the first has dimensionality $m \times n$ and the last dimensionality $n\times n$. We have then
|
||||
|
||||
|
||||
A general
|
||||
$m\times n$ matrix $\hat{A}$ can be written in terms of a diagonal
|
||||
matrix $\hat{D}$ of dimensionality $n\times n$ and two orthognal
|
||||
matrices $\hat{U}$ and $\hat{V}$, where the first has dimensionality
|
||||
$m \times m$ and the last dimensionality $n\times n$.
|
||||
We have then
|
||||
!bt
|
||||
\[
|
||||
\hat{A} = \hat{U}\hat{\Sigma}\hat{V}
|
||||
\]
|
||||
\[
|
||||
\hat{A} = \hat{U}\hat{D}\hat{V}^T
|
||||
\]
|
||||
!et
|
||||
!eblock
|
||||
|
||||
|
||||
Add codes and discuss this in connection with lasso and ridge, show example where the standard inversion of a matrix fails and where SVD comes to rescue. Include first a discussion of the general SVD and then discuss the thin SVD.
|
||||
|
||||
|
||||
!split
|
||||
===== Lasso and Ridge regression =====
|
||||
|
||||
@@ -957,7 +961,7 @@ Discuss the mathematics here
|
||||
|
||||
|
||||
!split
|
||||
===== Ridge and Lasso Regression =====
|
||||
===== Code examples for Ridge and Lasso Regression =====
|
||||
|
||||
!bc pycod
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
Reference in New Issue
Block a user