当前位置:网站首页>[linear algebra] understand positive definite matrix and semi positive definite matrix
[linear algebra] understand positive definite matrix and semi positive definite matrix
2022-06-09 09:41:00 【Poor and poor to an annual salary of millions】
1 Definition
In machine learning and spectral graph theory , The concept of positive definite matrix and positive semidefinite matrix is always used , In order to understand their concept is very necessary .
Definition : Positive definite matrix (positive definite, PD)
Given a size of n × n n×n n×n Real symmetric matrix of A A A, If for any length it is n n n Nonzero vector of X X X, Yes X T A X > 0 X^TAX>0 XTAX>0 Hang up , Then the matrix A A A It's a positive definite matrix .
Definition : Positive semidefinite matrices (positive semi-definite, PSD)
Given a size of n × n n×n n×n Real symmetric matrix of A A A, If for any length it is n n n Nonzero vector of X X X, Yes X T A X ≥ 0 X^TAX \ge 0 XTAX≥0 Hang up , Then the matrix A A A It's a positive definite matrix .
Look at an example ( Source references 【3】):
(1) Unit matrix I ∈ R 2 × 2 I \in \mathbb{R}^{2 \times 2} I∈R2×2 Is it a positive definite matrix ?
A vector x = [ x 1 x 2 ] ∈ R 2 \boldsymbol{x}=\left[\begin{array}{l} x_{1} \\ x_{2} \end{array}\right] \in \mathbb{R}^{2} x=[x1x2]∈R2 For the wrong 0 0 0 vector , be
x T I x = x T x = x 1 2 + x 2 2 \boldsymbol{x}^{T} I \boldsymbol{x}=\boldsymbol{x}^{T} \boldsymbol{x}=x_{1}^{2}+x_{2}^{2} xTIx=xTx=x12+x22
because x ≠ 0 \boldsymbol{x} \neq \mathbf{0} x=0, so x T I x > 0 \boldsymbol{x}^{T} I \boldsymbol{x}>0 xTIx>0 Hang up , So the identity matrix is a positive definite matrix .
From the above example, we can see that positive definite matrix and semi positive definite matrix are similar to quadratic function . With a quadratic function y = a x 2 y=ax^2 y=ax2 For example , The curve of this function will pass through the coordinate origin , When parameters a > 0 a>0 a>0 when , Curved “ Opening ” Up , Parameters a < 0 a<0 a<0 when , Curved “ Opening ” Down .
You can actually sum a quadratic function with y = a x 2 y=ax^2 y=ax2 and y = x T A x y=x^TAx y=xTAx Compare .
- stay y = a x 2 y=ax^2 y=ax2 in , if a > 0 a>0 a>0, Then for any x ≠ 0 x\neq0 x=0, Then there are y > 0 y>0 y>0 Hang up .
Corresponding to y = x T A x y=x^TAx y=xTAx, if A A A Is a positive definite matrix , Then for any x ≠ 0 x\neq0 x=0, Then there are y > 0 y>0 y>0 Hang up . - stay y = a x 2 y=ax^2 y=ax2 in , if a ≥ 0 a\geq0 a≥0, Then for any x ≠ 0 x\neq0 x=0, Then there are y ≥ 0 y\geq0 y≥0 Hang up .
Corresponding to y = x T A x y=x^TAx y=xTAx, if A A A Is a positive semidefinite matrix , Then for any x ≠ 0 x\neq0 x=0, Then there are y ≥ 0 y\geq0 y≥0 Hang up .
2 Understand from a geometric point of view
If any positive definite matrix is given A ∈ R n × n A\in R^{n\times n} A∈Rn×n And a non 0 0 0 vector x ∈ R n x\in R^n x∈Rn, Then the vector obtained by multiplying the two y = A x ∈ R n y=Ax\in R^n y=Ax∈Rn And vector x x x The included angle of is always less than 9 0 . 90^. 90. Equivalent to x T A x > 0 x^TAx>0 xTAx>0.
From the essence of matrix, matrix multiplication is actually a vector x x x Installation matrix A A A Transform in the specified way ( Matrix understanding series ( One )( Two )( 3、 ... and )). So for a positive definite matrix x T A x = x T M > 0 x^TAx=x^TM>0 xTAx=xTM>0, remember M = A x M=Ax M=Ax. Do you remember C o s Cos Cos The formula
cos * x , y * = x T y ∥ x ∥ ⋅ ∥ y ∥ \cos \langle\boldsymbol{x}, \boldsymbol{y}\rangle=\frac{\boldsymbol{x}^{T} \boldsymbol{y}}{\|\boldsymbol{x}\| \cdot\|\boldsymbol{y}\|} cos*x,y*=∥x∥⋅∥y∥xTy
Here we can understand that the function of a positive definite matrix is : A vector x x x Through a positive definite matrix A A A After transformation, the original vector x x x The included angle of is less than 9 0 . 90^. 90..
Let's take another example : Given orientation x = [ 2 1 ] x=\left[\begin{array}{l}2 \\1\end{array}\right] x=[21], For the identity matrix I = [ 1 0 0 1 ] I=\left[\begin{array}{ll}1 & 0 \\0 & 1\end{array}\right] I=[1001], be
y = I x = x = [ 2 1 ] \boldsymbol{y}=I \boldsymbol{x}=\boldsymbol{x}=\left[\begin{array}{l} 2 \\1\end{array}\right] y=Ix=x=[21] Then the vector y and x y and x y and x An Angle of 0.
cos * x , y * = x T y ∥ x ∥ ⋅ ∥ y ∥ = 2 × 2 + 1 × 1 2 2 + 1 2 ⋅ 2 2 + 1 2 = 1 \begin{array}{l} \cos \langle\boldsymbol{x}, \boldsymbol{y}\rangle=\frac{\boldsymbol{x}^{T} \boldsymbol{y}}{\|\boldsymbol{x}\| \cdot\|\boldsymbol{y}\|} \\ =\frac{2 \times 2+1 \times 1}{\sqrt{2^{2}+1^{2}} \cdot \sqrt{2^{2}+1^{2}}} \\ =1 \end{array} cos*x,y*=∥x∥⋅∥y∥xTy=22+12⋅22+122×2+1×1=1
Combined with the above example and the motion of the matrix, we can understand the positive definite matrix :
- For a vector x x x, We hope x x x There's a matrix passing through A A A The new vector after the change of M M M The angle between it and itself is less than 90 90 90 degree .
- Less than 90 90 90 The meaning behind degree is the transformed vector M M M It's along the original vector x x x In the positive direction of ( namely M M M When you project back to the original vector, the direction remains unchanged )
So how to understand the requirement that the eigenvalue of a positive definite matrix should be greater than 0?
First, a matrix A A A Eigenvector of x x x It means that a vector will transform along the direction of the eigenvector ( The zoom ), The scaling is determined by the eigenvalue λ \lambda λ decision .( Understanding of eigenvalues and eigenvectors ). for instance 【 reference 【1】】:
A 1 = [ [ 0.5 , 0 ] T , [ 0 , 2 ] T ] A_1=[[0.5, 0]^T,[0, 2]^T] A1=[[0.5,0]T,[0,2]T] It's very easy to calculate A The eigenvalues of are respectively 0.5 0.5 0.5 and 2 2 2, And their corresponding eigenvectors are [ 1 , 0 ] T [1,0]^T [1,0]T and [ 0 , 1 ] T [0,1]^T [0,1]T . So if a vector b b b Multiply left by a matrix A A A, The essence of this is to put vectors b b b Along [ 1 , 0 ] T [1,0]^T [1,0]T and [ 0 , 1 ] T [0,1]^T [0,1]T The directions are magnified separately 0.5 0.5 0.5 and 2 2 2 times . We assume that b = [ 2 , 2 ] T b=[2,2]^T b=[2,2]T, that A b Ab Ab The resulting vector is [ 1 , 4 ] T [1, 4]^T [1,4]T, Combined with the figure below, it's more intuitive :
The picture comes from the references 【1】
Let's look at the picture , If one of the eigenvalues is less than 0 0 0, such as λ 1 < 0 \lambda_1<0 λ1<0 So the final vector A b Ab Ab The vector projected to the direction is related to b b b reverse . Sum up , To make the transformed vector M M M And the original vector x x x The included angle is less than 90 90 90 degree , That is, when mapping back to the original vector, keep the direction unchanged , Then the eigenvalue needs to be greater than 0 0 0, So that's why the eigenvalues of positive definite matrices are greater than 0 0 0.
A x = λ x → x T A x = λ x T x = λ ∥ x ∥ 2 > 0 \begin{array}{c} A x=\lambda x \\ \rightarrow x^{T} A x=\lambda x^{T} x=\lambda\|x\|^{2}>0 \end{array} Ax=λx→xTAx=λxTx=λ∥x∥2>0
so λ Must be greater than 0, That is, the characteristic value must be greater than 0.
The relationship between positive definite matrix and optimization is used in the supplement .
3 reference
[1] How to understand positive definite matrix and semi positive definite matrix
[2]MIT Notes on Linear Algebra 3.3( Positive definite matrix , minimum value )
[3] Talking about 「 Positive definite matrix 」 and 「 Positive semidefinite matrices 」
[4]MIT Notes on Linear Algebra 3.1( Symmetric matrix , Positive definite matrix
边栏推荐
- Project interview questions
- 2022-2028 global leisure special sand industry research and trend analysis report
- MySQL基础 基础认知
- Summary of Android development interview experience and compilation of actual records (must see)
- How do you view the multi runtime architecture of dapr and layotto?
- Longest common subsequence and longest common substring
- MySQL basic subquery
- 2022-2028 global social finance industry research and trend analysis report
- Kusionstack has a sense of open source | it took two years to break the dilemma of "separating lines like mountains"
- LeetCode_ Sort_ Medium_ 406. reconstruct the queue based on height
猜你喜欢
随机推荐
了解图数据库neo4j(三)
Change exchange (boundary protection should work before array access) (if there is no such combination, dp[i] should also be integer.max_value - 1) leetcode 80
HAVE FUN | SOFAArk 源码解析活动
SSM详解
MySQL basic DML and DDL learning
最长公共子序列和最长公共子串
【Android -- 面试】程序员月入过 W 的十大平台
MySQL基础 函数篇
Paper understanding [RL - exp replay] - an equivalence between loss functions and non uniform sampling in exp replay
最小路径和
Omit application reduces TS duplicate codes
了解图数据库neo4j(一)
MySQL基础 查询语句
WebRTC系列--计算帧率及帧间隔
How do you view the multi runtime architecture of dapr and layotto?
如何看待 Dapr、Layotto 這種多運行時架構?
Linux online installation of a neo4j diagram database
Crop the target area in the image according to the projection coordinates (with complete code)
Minimum path sum
Countdown 3 days 𞓜 sofachannel 28 sofaark class isolation framework design









