1、Trace
the trace of a square matrix A is defined as the sum of elements on the main diagonal of A .
The trace of a matrix is sum of the eigenvalues, and it is invariant with respect to a change of basis.
Properties :
t r ( A ) = t r ( A T ) tr(A)=tr(A^T) t r ( A ) = t r ( A T )
t r ( A + B ) = t r ( A ) + t r ( B ) tr(A+B)=tr(A)+tr(B) t r ( A + B ) = t r ( A ) + t r ( B )
t r ( c A ) = c t r ( A ) tr(cA)=ctr(A) t r ( c A ) = c t r ( A )
if A and B are two m by n matrics, then: t r ( A T B ) = t r ( A B T ) = t r ( B T A ) = t r ( B A T ) = ∑ i , j A i j B i j tr(A^TB)=tr(AB^T)=tr(B^TA)=tr(BA^T)=\sum_{i,j}A_{ij}B_{ij} t r ( A T B ) = t r ( A B T ) = t r ( B T A ) = t r ( B A T ) = ∑ i , j A i j B i j .This means that the trace of a product of equal-sized matrics functions similarly to a dot product of vectors.
A is an m by n matrix and B is an n by m matrix, then: t r ( A B ) = t r ( B A ) tr(AB)=tr(BA) t r ( A B ) = t r ( B A ) .
Cyclic property: t r ( A B C D ) = t r ( B C D A ) = t r ( C D A B ) = t r ( D A B C ) tr(ABCD)=tr(BCDA)=tr(CDAB)=tr(DABC) t r ( A B C D ) = t r ( B C D A ) = t r ( C D A B ) = t r ( D A B C ) .
Similarity invariance: t r ( P − 1 A P ) = t r ( A ) tr(P^{-1}AP)=tr(A) t r ( P − 1 A P ) = t r ( A ) .
Trace of projection matrix is the dimension of the target space: P X = X ( X T X ) − 1 X T ⇒ t r ( P x ) = r a n k ( X ) P_X=X(X^TX)^{-1}X^T \Rightarrow tr(P_x)=rank(X) P X = X ( X T X ) − 1 X T ⇒ t r ( P x ) = r a n k ( X )
2、協方差
方差,單個隨機變量的離散程度。
σ x 2 = 1 n − 1 ∑ i = 1 n ( x i − x ˉ ) 2 \sigma_x^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})^2 σ x 2 = n − 1 1 ∑ i = 1 n ( x i − x ˉ ) 2 .
協方差,兩個隨機變量的相似程度。
σ ( x , y ) = 1 n − 1 ∑ i = 1 n ( x i − x ˉ ) ( y i − y ˉ ) \sigma(x,y)=\frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y}) σ ( x , y ) = n − 1 1 ∑ i = 1 n ( x i − x ˉ ) ( y i − y ˉ ) .
協方差矩陣,d個隨機變量,兩兩之間的協方差。
Σ = [ σ ( x 1 , x 1 ) … σ ( x 1 , x d ) ⋮ ⋱ ⋮ σ ( x d , x 1 ) … σ ( x d , x d ) ] \Sigma=\left[ \begin{matrix} \sigma(x_1,x_1) & \dots & \sigma(x_1,x_d) \\ \vdots & \ddots & \vdots \\ \sigma(x_d,x_1) & \dots &\sigma(x_d, x_d) \end{matrix} \right] Σ = ⎣ ⎢ ⎡ σ ( x 1 , x 1 ) ⋮ σ ( x d , x 1 ) … ⋱ … σ ( x 1 , x d ) ⋮ σ ( x d , x d ) ⎦ ⎥ ⎤
X = [ x 1 x 2 … x n ] d ∗ n , x i ∈ R d X=\left[ \begin{matrix} x_1 & x_2 & \dots & x_n\end{matrix} \right]_{d*n}, x_i \in R^d X = [ x 1 x 2 … x n ] d ∗ n , x i ∈ R d
sample covariance S = X X T = [ x 1 … x n ] [ x 1 T ⋮ x n T ] T S=XX^T=\left[ \begin{matrix}x_1 & \dots & x_n \end{matrix} \right]\left[ \begin{matrix}x_1^T \\ \vdots \\ x_n^T \end{matrix} \right]^T S = X X T = [ x 1 … x n ] ⎣ ⎢ ⎡ x 1 T ⋮ x n T ⎦ ⎥ ⎤ T 是d ∗ d d*d d ∗ d 的矩陣,第i i i 行,第j j j 列是第i i i 個屬性和第j j j 個屬性的協方差。
3、空間
Euclidean space, norm,兩者是什麼關係,還有什麼空間,這是哪門課的概念?
不嚴謹的理解
歐式空間(希爾伯特空間):線性空間
歐式幾何,幾何原本中五個基本假設:
兩點定一線
線段變直線
圓心+半徑 圓
直角都相等
過直線外一點有且只有一條平行線
前4個比較直觀,第5個沒法證明。
洛巴切夫斯基:過直線外一點,有多條平行線。
羅氏幾何
黎曼:過直線外一點,沒有平行線。比如,球面。
非歐幾何。
愛因斯坦 宇宙空間 彎曲的空間 航海學
參考:https://www.youtube.com/watch?v=_l7gyzguikE
4、正太分佈
p ( x ) = 1 2 π σ e − ( x − μ ) 2 2 σ 2 p(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}} p ( x ) = 2 π σ 1 e − 2 σ 2 ( x − μ ) 2
p ( x ) = 1 ( 2 π ) 1 / k ∣ Σ ∣ e − ( x − μ ) T Σ − 1 ( x − μ ) p(x)=\frac{1}{\sqrt{(2\pi)^{1/k}|\Sigma|}}e^{-(x-\mu)^T\Sigma^{-1}(x-\mu)} p ( x ) = ( 2 π ) 1 / k ∣ Σ ∣ 1 e − ( x − μ ) T Σ − 1 ( x − μ )
5、距離、範數
定義:設X X X 是一個非空集合,任意給定一對這一集合的元素x , y x,y x , y ,都給定一個實數d ( x , y ) d(x,y) d ( x , y ) 與它們對應,並且滿足:
d ( x , y ) ≥ 0 d(x,y)\ge 0 d ( x , y ) ≥ 0
d ( x , y ) = 0 d(x,y)=0 d ( x , y ) = 0 if and only if x = y x=y x = y
d ( x , y ) = d ( y , x ) d(x,y)=d(y,x) d ( x , y ) = d ( y , x )
d ( x , y ) ≤ d ( x , z ) + d ( z , y ) d(x,y)\le d(x,z)+d(z,y) d ( x , y ) ≤ d ( x , z ) + d ( z , y )
則稱d ( x , y ) d(x,y) d ( x , y ) 是這兩點之間的距離。
抽象
最重要的屬性
具體
定義:設∣ ∣ x ∣ ∣ ||x|| ∣ ∣ x ∣ ∣ 是R n R^n R n 的範數,若滿足:
∣ ∣ x ∣ ∣ ≥ 0 , ∀ x ∈ R n ||x||\ge 0, \forall x \in R^n ∣ ∣ x ∣ ∣ ≥ 0 , ∀ x ∈ R n
∣ ∣ x ∣ ∣ = 0 ||x||=0 ∣ ∣ x ∣ ∣ = 0 if and only if x = 0 x=0 x = 0
∣ ∣ α x ∣ ∣ = ∣ α ∣ ∣ ∣ x ∣ ∣ , ∀ α ∈ R , x ∈ R n ||\alpha x||=|\alpha|||x||, \forall \alpha \in R, x \in R^n ∣ ∣ α x ∣ ∣ = ∣ α ∣ ∣ ∣ x ∣ ∣ , ∀ α ∈ R , x ∈ R n
∣ ∣ x + y ∣ ∣ ≤ ∣ ∣ x ∣ ∣ + ∣ ∣ y ∣ ∣ , ∀ x , y ∈ R n ||x+y||\le ||x||+||y||, \forall x, y \in R^n ∣ ∣ x + y ∣ ∣ ≤ ∣ ∣ x ∣ ∣ + ∣ ∣ y ∣ ∣ , ∀ x , y ∈ R n
注:簡單看成到零點距離多了3
內積空間
定義:設( x , y ) ∈ R (x,y)\in R ( x , y ) ∈ R , 且滿足:
對稱性
對第一變元的線性性
正定性
則稱( x , y ) (x,y) ( x , y ) 爲內積。
歐幾里得幾何學需要內積,但連續的概念不需要內積,甚至不需要距離。例如:社交圈的描述;學號的指定是“連續”的。
元素
規則
具體(加東西)
---------------------內積(歐式空間、希爾伯特空間)--------------------範數(巴納赫空間)----------------距離--------------拓撲空間---------》抽象(減東西)
參考:http://open.163.com/newview/movie/free?pid=M8PTB0GHI&mid=M8PTBUHT0
6、for any matrix A A A with column A i A_i A i the following identity is true:
∥ A ∥ 2 = ∥ A i T A i ∥ 2 = T r ( A T A ) \left\lVert A\right\rVert^2= \left\lVert A_i^TA_i\right\rVert^2=Tr(A^TA) ∥ A ∥ 2 = ∥ ∥ A i T A i ∥ ∥ 2 = T r ( A T A )
https://en.wikipedia.org/wiki/Matrix_norm
7、max Y T r ( Y T M Y ) s . t . Y T Y = I d ∗ d \max_Y \ Tr(Y^TMY) \\ s.t. \ Y^TY=I_{d*d} Y max T r ( Y T M Y ) s . t . Y T Y = I d ∗ d
solution is maximum eigenvectors of M.
min Y T r ( Y T M Y ) s . t . Y T Y = I d ∗ d \min_Y \ Tr(Y^TMY) \\ s.t. \ Y^TY=I_{d*d} Y min T r ( Y T M Y ) s . t . Y T Y = I d ∗ d
solution is minmum eigenvectors of M.
(6,7不理解,先記住)