Acest lucru vă va șterge progresul și datele de chat pentru toate capitolele din acest curs și nu poate fi anulat!
Glosar
Selectați unul dintre cuvintele cheie din stânga ...
Linear AlgebraEigenanalysis
Timp de citit: ~50 min
In this section we will see how we can better understand a linear transformation by breaking it down into linear transformations.
Let be a linear transformation from to .Suppose that is a basis of , that is the span of some of the vectors in , and that is the span of the remaining vectors in .Then any vector in can be written as the sum of a vector in and a vector in .Since , we can see how behaves on all of if we know how it behaves on and on .This decomposition is particularly helpful if and are chosen so that behaves in a simple way on and on .
Given such a decomposition of into the vector spaces and , we can apply the same idea to split and into lower-dimensional vector spaces and repeat until no more splits are possible. The most optimistic outcome of this procedure would be that we get all the way down to one-dimensional subspaces and that acts on each of these subspaces by simply scaling each vector in that subspace by some factor. In other words, we would like to find vectors for which is a scalar multiple of .This leads us to the following definition.
Definition An eigenvector of an matrix is a nonzero vector with the property that for some (in other words, maps to a vector which is either zero or parallel to ). We call an eigenvalue of , and we call the eigenvector together with its eigenvalue an eigenpair.
Example Every nonzero vector is an eigenvector (with eigenvalue ) of the identity matrix.
Exercise Find a matrix with eigenpairs and .Sketch the images of some gridlines under multiplication by this matrix to show how it scales space along the lines through its eigenvectors. Verbally describe your results below.
Solution.Writing out the equations implied by the given eigenpair relations, we see that the first implies that the first column of the matrix is , and the second (together with the first) implies that the second column of the matrix is .
The following gridline images show how the transformation distorts space. Equally spaced points which are separated in the east-west direction get spread out by a factor of 2, while the diagonal line gets stretched out by a factor of 3. Since , this introduces a bottom-left-to-top-right tilt for the images of the vertical gridlines.
Eigenspaces
If are eigenvectors of with the same eigenvalue and for some weights such that for at least one then is also an eigenvector of with eigenvalue because
Therefore, the set of all eigenvectors corresponding to a particular eigenvalue form a .Such a space is called an eigenspace.
Exercise Let be a matrix, with eigenvectors and \begin{bmatrix} 0 \\\ 0 \\\ 2 \\\ -3\end{bmatrix}, both with eigenvalue 3.Find A\left(\begin{bmatrix} 5 \\\ 5 \\\ 8 \\\ -12 \end{bmatrix}\right).
Let V \subset \mathbb{R}^n be a subspace spanned by the eigenvectors of a matrix A.If \mathbf{v} \in V, which of the following are necessarily true?
XEQUATIONX3235XEQUATIONX
XEQUATIONX3236XEQUATIONX is orthogonal to every vector in XEQUATIONX3237XEQUATIONX
XEQUATIONX3238XEQUATIONX and \mathbf{v} are always linearly dependent.
Solution.Let \mathbf{a}_1, \dots, \mathbf{a}_k be the eigenvectors of A that span V and let \lambda_1, \dots, \lambda_k be the corresponding eigenvalues. Then \mathbf{v} \in V admits a representation \mathbf{v} = v_1\mathbf{a}_1 + \cdots + v_k\mathbf{a}_k.Since
we see that A\mathbf{v} is also in V.This means (2) is not true in general. Option (3) need not always hold. For instance, it fails to hold if \mathbf{v} = \mathbf{a}_1 + \mathbf{a}_2 and \lambda_1 and \lambda_2 are both non-zero and not equal. Therefore the only true statement is (1) A\mathbf{v} \in V.
Exercise Suppose A is a matrix with a eigenvector \mathbf{v} whose eigenvalue is 2 and an eigenvector \mathbf{w} whose eigenvalue is 2. Let \mathbf{u = v+w}.Explain why
Since \lim\limits_{n \to \infty} \left(\frac{3 \cdot 2}{3^2}\right)^n = \lim\limits_{n \to \infty} \left(\frac{2}{3}\right)^{2n} = 0, we find that \lim\limits_{n \to \infty} \frac{|A^n\mathbf{u}|^2}{| A^n \mathbf{v}|^2} = 1.
Diagonalization
If an n\times n matrix A has n linearly independent eigenvectors, then we can think of the one-dimensional subspaces spanned by each of these vectors as (not necessarily orthogonal) axes along which A acts by scaling.
In matrix terms, we can define V to be the matrix with the eigenvectors of A as columns. Then from the definition of an eigenpair, we have
\begin{align*}AV = V \Lambda,\end{align*}
where \Lambda is a matrix whose diagonal entries are the eigenvalues (in order corresponding to the columns of V) and whose other entries are zero. By the invertible matrix theorem, the assumption about V's columns being linearly independent implies that V is invertible, so we find that A = V \Lambda V^{-1}, where \Lambda is a diagonal matrix, and we say that A is diagonalizable.
Exercise Some matrices are not diagonalizable, because they correspond to geometric transformations that cannot be viewed as scaling along any set of axes. Use this geometric intuition to come up with a 2 \times 2 matrix which is not diagonalizable.
Solution.Rotation matrices in \mathbb{R}^2(except for 0 degree rotations and 180-degree rotations) are not diagonalizable. For example, the 90-degree rotation matrix
does not send any nonzero vector \vec{v} \in \mathbb{R}^2 to a multiple of itself.
Exercise Suppose that we have diagonalized A as A = VDV^{-1}.Then A^{3} is equal to
Let B be another matrix, with eigenpairs (\mathbf{v}_1,3) and (\mathbf{v}_{2},-2).Let \mathbf{u} = 2\mathbf{v}_{1} + \mathbf{v}_{2}.Which of the following is equal to B^{n}(\mathbf{u})?
XEQUATIONX3247XEQUATIONX.
XEQUATIONX3248XEQUATIONX.
XEQUATIONX3249XEQUATIONX.
None of the above.
Solution.We have
\begin{align*}A^2 = VDV^{-1} VDV^{-1} = V D^2 V^{-1}\end{align*}
because V^{-1} V = I is the identity matrix. Similarly, A^3 = V D^3 V^{-1}.
By linearity B^n(\mathbf{u}) = 2B^n\mathbf{v}_1 + B^n \mathbf{v}_2.But B^n(\mathbf{v}_1) = 3^n\mathbf{v}_1 and B^n(\mathbf{v}_2) = (-2)^n\mathbf{v}_2 because \mathbf{v}_1 and \mathbf{v}_2 are eigenvectors of B.Therefore B^n(\mathbf{u}) = 2(3)^n\mathbf{v}_1 + (-2)^n\mathbf{v}_2.
Positive definite matrices
A positive definite matrix A is a symmetric matrix whose eigenvalues are all positive. A positive semidefinite matrix A is a symmetric matrix whose eigenvalues are all nonnegative. Equivalently, a symmetric matrix A is positive semidefinite if \mathbf{x}' A \mathbf{x} \ge 0 for all \mathbf{x}.
Negative definite and negative semidefinite matrices are defined analogously.
Exercise (i) Is the sum of two positive definite matrices necessarily positive definite?
Solution.(i) If A and B are n \times n positive definite matrices, then A + B is also positive definite because
\begin{align*}\mathbf{x}' (A + B) \mathbf{x} &= \mathbf{x}' (A\mathbf{x} + B\mathbf{x}) \\ &= \mathbf{x}' A\mathbf{x} + \mathbf{x}' B\mathbf{x}\end{align*}
for any vector \mathbf{x} \in \mathbb{R}^n.
The Gram matrix
If A is an m\times n matrix, then A' A is its Gram matrix. The Gram matrix of A is always positive semidefinite:
Exercise Let X = A' A be a Gram matrix, and let \mathbf{v} be a vector. Which of the following is equal to \mathbf{v}' X\mathbf{v}?
|A\mathbf{v}|^2.
XEQUATIONX3250XEQUATIONX.
XEQUATIONX3251XEQUATIONX.
Using your answer above, explain why a Gram matrix is always positive semidefinite, but not necessarily positive definite.
Solution.The correct answer is |A\mathbf{v}|^2 because
From this we see that the Gram matrix is positive semidefinite because |A\mathbf{v}|^2 \geq 0.Since it is possible to have A\mathbf{v} = \mathbf{0} even if \mathbf{v} \neq \mathbf{0} (for example when A has linearly dependent columns), we see that the Gram matrix is not necessarily positive definite.
Exercise Explain why the rank of A is equal to the rank of A'A.(Hint: consider the null spaces of A and A'A.)
Solution.If A\mathbf{x} = \boldsymbol{0}, then multiplying both sides by A' gives A' A \mathbf{x} = \boldsymbol{0}.Therefore, the null space of A is a subset of the null space of A' A.
Conversely, if A' A \mathbf{x} = \boldsymbol{0}, then we can multiply this equation on the left by \mathbf{x}' to get
\begin{align*}\mathbf{x}' A' A \mathbf{x} = \boldsymbol{0},\end{align*}
which in turn implies that |A\mathbf{x}|^2 = \boldsymbol{0}.A vector has zero norm only if it's the zero vector, so we conclude that A\mathbf{x} = \boldsymbol{0}.
Since A and A' A have the same null space dimension and have the same domain (\mathbb{R}^n), they also have the same rank, by the rank-nullity theorem.
The Spectral Theorem
The eigenspace decomposition of a diagonalizable matrix is even easier to understand if the eigenvectors happen to be orthogonal. It turns out that this happens exactly when the matrix is symmetric:
Theorem (Spectral Theorem) If A is an n\times n symmetric matrix, then A is orthogonally diagonalizable, meaning that A has n eigenvectors which are pairwise orthogonal.
Conversely, every orthogonally diagonalizable matrix is symmetric.
In other words, if A is symmetric, then the one-dimensional subspaces along which A is decomposed form a set of axes for \mathbb{R}^n which are orthogonal. In matrix terms, we have
\begin{align*}A = V \Lambda V',\end{align*}
for some orthogonal matrix V.
Although it seems that the spectral theorem may be of limited use since so many matrices are not symmetric, we will see that we can associate any rectangular matrix with a symmetric square matrix that we can apply the spectral theorem to and use to extract insight about the original matrix. This beautiful idea is called the singular value decomposition and is the subject of the next section.
Exercise Given an invertible matrix A, we are often interested in solving a system of the form A \mathbf{x} = \mathbf{b}.Our knowledge of \mathbf{b} is seldom perfect however, so it is important to consider what happens to the solution if we replace \mathbf{b} with a slightly different vector \widehat{\mathbf{b}}.
It is possible that a small change in \mathbf{b} leads to a substantial change in the vector \mathbf{x}=A^{-1}\mathbf{b}.
Find an invertible 2\times 2 matrix A all of whose entries are between -2 and 2 and a vector \mathbf{b} with entries between -2 and 2 and another vector \widehat{\mathbf{b}} whose components are nearly equal to those of \mathbf{b} for which A^{-1}\mathbf{b} and A^{-1}\widehat{\mathbf{b}} are not very close.
To be concrete, let's say "nearly equal" means "having ratio between 0.99 and 1.01", and let's say that "not very close" means "having a difference whose norm is greater than the norm of either". Find the eigenvalues of your matrix A.
Solution.One simple way to do this is make \mathbf{b} and \widehat{\mathbf{b}} the columns of the matrix. For example, solve(array([[1,1],[1, 1.01]]),[1,1]) returns [1,0] while solve(array([[1,1],[1, 1.01]]),[1,1.01]) returns [0,1].
Solution.One simple way to do this is make \mathbf{b} and \widehat{\mathbf{b}} the columns of the matrix. For example, [1 1; 1 1.01] [1, 1] returns [1, 0], while [1 1; 1 1.01] [1, 1.01] returns [0, 1].
from numpy.linalg import solve
from numpy import array
[1 1; 1 1.01] \ [1, 1]
The eigenvalues of the matrix [1 1; 1 1.01] are approximately 0.005 and 2.005. In particular, the ratio of the eigenvalues is very large. You will find that the ratio of eigenvalues for your matrix is also large, because a matrix A with a modest maximum eigenvalue ratio is backwards stable, meaning that small changes in \mathbf{b} do not lead to large changes in A^{-1}\mathbf{b},