|
29 | 29 | $$
|
30 | 30 |
|
31 | 31 | $$
|
32 |
| -\text { with } A=\left[\begin{array}{cc}{4} & {-5} \\ {-2} & {3}\end{array}\right], b=\left[\begin{array}{c}{13} \\ {-9}\end{array}\right] |
| 32 | +\text { with } A=\left[\begin{array}{cc}{4} & {-5} \\ {-2} & {3}\end{array}\right], b=\left[\begin{array}{c}{-13} \\ {9}\end{array}\right] |
33 | 33 | $$
|
34 | 34 |
|
35 | 35 | 我们可以看到,这种形式的线性方程有许多优点(比如明显地节省空间)。
|
|
252 | 252 | 如**CS229**讲义中所述,迹具有以下属性(如下所示):
|
253 | 253 |
|
254 | 254 | - 对于矩阵$A \in \mathbb{R}^ {n \times n}$,则:$\operatorname{tr}A =\operatorname{tr}A^T$
|
| 255 | + |
255 | 256 | - 对于矩阵$A,B \in \mathbb{R}^ {n \times n}$,则:$\operatorname{tr}(A + B) = \operatorname{tr}A + \operatorname{tr}B$
|
| 257 | + |
256 | 258 | - 对于矩阵$A \in \mathbb{R}^ {n \times n}$,$ t \in \mathbb{R}$,则:$\operatorname{tr}(tA) = t\operatorname{tr}A$.
|
| 259 | + |
257 | 260 | - 对于矩阵 $A$, $B$,$AB$ 为方阵, 则:$\operatorname{tr}AB = \operatorname{tr}BA$
|
| 261 | + |
258 | 262 | - 对于矩阵 $A$, $B$, $C$, $ABC$为方阵, 则:$\operatorname{tr}ABC = \operatorname{tr}BCA=\operatorname{tr}CAB$, 同理,更多矩阵的积也是有这个性质。
|
259 | 263 |
|
| 264 | +作为如何证明这些属性的示例,我们将考虑上面给出的第四个属性。 假设$A \in \mathbb{R}^ {m \times n}$和$B \in \mathbb{R}^ {n \times m}$(因此$AB \in \mathbb{R}^ {m \times m}$是方阵)。 观察到$BA \in \mathbb{R}^ {n \times n}$也是一个方阵,因此对它们进行迹的运算是有意义的。 要证明$\operatorname{tr}AB = \operatorname{tr}BA$,请注意: |
| 265 | + |
260 | 266 | $$
|
261 | 267 | \begin{aligned} \operatorname{tr} A B &=\sum_{i=1}^{m}(A B)_{i i}=\sum_{i=1}^{m}\left(\sum_{j=1}^{n} A_{i j} B_{j i}\right) \\ &=\sum_{i=1}^{m} \sum_{j=1}^{n} A_{i j} B_{j i}=\sum_{j=1}^{n} \sum_{i=1}^{m} B_{j i} A_{i j} \\ &=\sum_{j=1}^{n}\left(\sum_{i=1}^{m} B_{j i} A_{i j}\right)=\sum_{j=1}^{n}(B A)_{j j}=\operatorname{tr} B A \end{aligned}
|
262 | 268 | $$
|
|
664 | 670 |
|
665 | 671 | 这里,关键是要明确我们要区分的变量。
|
666 | 672 | 在第一种情况下,我们将函数$f$与其参数$z$进行区分,然后替换参数$Ax$。
|
667 |
| -在第二种情况下,我们将复合函数$g(x)=f(Ax)$直接与x进行微分。 |
| 673 | +在第二种情况下,我们将复合函数$g(x)=f(Ax)$直接与$x$进行微分。 |
668 | 674 |
|
669 | 675 | 我们将第一种情况表示为$\nabla zf(Ax)$,第二种情况表示为$\nabla xf(Ax)$。
|
670 | 676 |
|
|
763 | 769 |
|
764 | 770 | 让我们应用上一节中得到的方程来推导最小二乘方程。假设我们得到矩阵$A\in \mathbb{R}^{m \times n}$(为了简单起见,我们假设$A$是满秩)和向量$b\in \mathbb{R}^{m}$,从而使$b \notin \mathcal{R}(A)$。在这种情况下,我们将无法找到向量$x\in \mathbb{R}^{n}$,由于$Ax = b$,因此我们想要找到一个向量$x$,使得$Ax$尽可能接近 $b$,用欧几里德范数的平方$\|A x-b\|_{2}^{2} $来衡量。
|
765 | 771 |
|
766 |
| -使用公式$\|x\|^{2}=x^Tx$“,我们可以得到: |
| 772 | +使用公式$\|x\|^{2}=x^Tx$,我们可以得到: |
767 | 773 |
|
768 | 774 | $$
|
769 | 775 | \begin{aligned}\|A x-b\|_{2}^{2} &=(A x-b)^{T}(A x-b) \\ &=x^{T} A^{T} A x-2 b^{T} A x+b^{T} b \end{aligned}
|
|
821 | 827 | $$
|
822 | 828 | 请注意,这只是线性方程$Ax =\lambda x$。 这表明假设$x^T x = 1$,可能最大化(或最小化)$x^T Ax$的唯一点是$A$的特征向量。
|
823 | 829 |
|
824 |
| -**线性代数已经翻译完毕,后面的概率论部分还在翻译中,请关注[github](https://github.com/fengdu78/Data-Science-Notes/tree/master/0.math)的更新,近期将更新完。** |
| 830 | +**线性代数和概率论都已经翻译完毕,请关注[github](https://github.com/fengdu78/Data-Science-Notes/tree/master/0.math)的更新,若有修改将在github上更新** |
825 | 831 |
|
826 | 832 | 欢迎大家提交PR,对语言进行润色。
|
827 | 833 |
|
|
0 commit comments