且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Matlab和Python采取的特征向量的符号差异

更新时间:2023-02-26 14:40:56

它们是相同的特征向量,因为翻转特征向量上的符号不会改变其表示形式-它们将具有相同的特征值.因此,它不会影响进一步的计算.

They are the same eigenvectors, as flipping the signs on eigenvectors does not change their formulation - they will have the same eigenvalue. It will not affect further calculations as a result.

为什么它们的计算方式不同? 最有可能的原因是,运行的子例程会根据所操作的矩阵而有所不同,并且不关心它们返回的符号"是什么,因为特征值没有一个.

Why are they calculated differently? Most likely because the subroutines that are run vary based on the matrix that is being operated on, and don't care what 'sign' they return because eigenvalues don't have one.

简单的数学证明:

如果x是具有特征值q的矩阵A的特征向量,则根据定义,我们具有Ax = qx.

If x is an eigenvector of matrix A with eigenvalue q, then by definition we have that Ax = qx.

由此得出,A(-x) = -(Ax) = -(qx) = q(-x)使得-x是具有相同特征值的特征向量.

It follows that A(-x) = -(Ax) = -(qx) = q(-x) such that -x is an eigenvector with the same eigenvalue.