This commit is contained in:
Morten Hjorth-Jensen
2025-08-25 07:39:58 +02:00
parent 98e9066e2e
commit 1e92fbd109
69 changed files with 5119 additions and 5410 deletions
+6 -34
View File
@@ -155,7 +155,7 @@ will treat $y_i$ as our exact value for the output variable.
In order to find the parameters $\theta_i$ we will then minimize the spread of $C(\bm{\theta})$, that is we are going to solve the problem
!bt
\[
{\displaystyle \min_{\bm{\theta}\in
\hat{\bm{\theta}}={\displaystyle \min_{\bm{\theta}\in
{\mathbb{R}}^{p}}}\frac{1}{n}\left\{\left(\bm{y}-\bm{X}\bm{\theta}\right)^T\left(\bm{y}-\bm{X}\bm{\theta}\right)\right\}.
\]
!et
@@ -197,7 +197,7 @@ as
and if the matrix $\bm{X}^T\bm{X}$ is invertible we have the solution
!bt
\[
\bm{\theta} =\left(\bm{X}^T\bm{X}\right)^{-1}\bm{X}^T\bm{y}.
\hat{\bm{\theta}} =\left(\bm{X}^T\bm{X}\right)^{-1}\bm{X}^T\bm{y}.
\]
!et
@@ -209,11 +209,11 @@ matrices to invert. The methods discussed here and for many other
supervised learning algorithms like classification with logistic
regression or support vector machines, exhibit dimensionalities which
allow for the usage of direct linear algebra methods such as _LU_ decomposition or _Singular Value Decomposition_ (SVD) for finding the inverse of the matrix
$\bm{X}^T\bm{X}$. This is discussed on Thursday this week.
$\bm{X}^T\bm{X}$.
!eblock
!bblock
_Small question_: Do you think the example we have at hand here (the nuclear binding energies) can lead to problems in inverting the matrix $\bm{X}^T\bm{X}$? What kind of problems can we expect?
_Small question_: When inverting the matrix $\bm{X}^T\bm{X}, what kind of problems can we expect?
!eblock
!split
@@ -471,34 +471,6 @@ or as
!split
===== Other useful relations =====
We list here some other useful relations we may encounter (recall that vectors are defined by boldfaced low-key letters)
!bt
\[
\frac{\partial (\bm{x}^T\bm{a})}{\partial \bm{x}} = \bm{a}^T,
\]
!et
!bt
\[
\frac{\partial (\bm{a}^T\bm{x})}{\partial \bm{x}} = \bm{a}^T,
\]
!et
!bt
\[
\frac{\partial tr(\bm{B}\bm{A})}{\partial \bm{A}} = \bm{B}^T,
\]
!et
!bt
\[
\frac{\partial \log{\vert\bm{A}\vert}}{\partial \bm{A}} = (\bm{A}^{-1})^T.
\]
!et
!split
===== Meet the Hessian Matrix =====
@@ -526,11 +498,11 @@ The Hessian matrix plays an important role and is defined here as
For ordinary least squares, it is inversely proportional (derivation
next week) with the variance of the optimal parameters
$\hat{\bm{\theta}}$. Furthermore, we will see later this week that it is
$\hat{\bm{\theta}}$. Furthermore, we will see next week that it is
(aside the factor $1/n$) equal to the covariance matrix. It plays also a very
important role in optmization algorithms and Principal Component
Analysis as a way to reduce the dimensionality of a machine learning/data analysis
problem.
problem. We will discuss this in greater detail next week when we introduce gradient methods.
_Linear algebra question:_ Can we use the Hessian matrix to say something about properties of the cost function (our optmization problem)? (hint: think about convex or concave problems and how to relate these to a matrix!).