1. Home
  2. Explore
  3. Mathematics
  4. Positive Definite Matrices

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Positive Definite Matrices

Speaker 1Speaker 2

Positive Definite Matrices

9:45
0:00-9:45
  1. Simon

    Welcome back. Today we’re tying together several big ideas from linear algebra: eigenvalues, energy, the factorization involving A transpose A, determinants, and pivots. They all give us different ways to recognize a positive definite matrix.

  2. Corey

    And there’s a little course logistics in the background too: students are starting a Julia lab on convolution. It’s meant to be a gentle first lab—mostly building a matrix and checking that the autograder accepts it. Convolution belongs to signal processing, which we’ll reach later.

  3. Simon

    Right. For the math, let’s start with symmetric matrices. Their eigenvalues are real, and their eigenvectors can be chosen orthogonal. Positive definite matrices are a particularly useful kind of symmetric matrix: all their eigenvalues are positive.

  4. Corey

    That’s a simple definition, but it may not be the easiest way to test a matrix. If we’re given a matrix, finding every eigenvalue can take work. The point today is that there are several equivalent tests, and any one of them is enough.

  5. Simon

    Take the symmetric matrix with rows three, four and four, five. All its entries are positive, but that doesn’t make it positive definite. Its determinant is fifteen minus sixteen, which is negative one.

  6. Corey

    And the determinant is the product of the eigenvalues. Since the eigenvalues are real and their product is negative, one is positive and one is negative. So this matrix is indefinite, not positive definite.

  7. Simon

    We can make the example positive definite by increasing the bottom-right entry from five to six. Then the matrix is three, four; four, six. Its determinant is eighteen minus sixteen, or two, and its first leading determinant is three. Both are positive.

  8. Corey

    That phrase, leading determinants, means we check determinants of the upper-left square blocks, growing one row and column at a time. For a two-by-two matrix, we check the upper-left one-by-one determinant and then the full two-by-two determinant. For a larger matrix, we continue that pattern.

  9. Simon

    Why do both matter? A positive determinant by itself is not enough. For instance, the matrix with diagonal entries negative three and negative six, and off-diagonal entries four, has determinant eighteen minus sixteen, or two. But its first leading determinant is negative three, so it fails the test.

  10. Corey

    There’s a close connection to elimination pivots. For the matrix three, four; four, six, the first pivot is three. Eliminate the four below it by subtracting four-thirds of row one from row two, and the second pivot becomes six minus sixteen-thirds, which is two-thirds.

  11. Simon

    Those pivots are both positive. And the second pivot equals the full determinant divided by the first leading determinant: two divided by three. So, for a symmetric matrix, positive leading determinants and positive pivots are two more ways to test positive definiteness.

  12. Corey

    Let’s turn to the test that gives the subject its physical-sounding name: energy. For a symmetric matrix S, take a vector x and form x transpose S x. That’s a quadratic function of the entries of x, and positive definiteness means this energy is positive whenever x isn’t the zero vector.

  13. Simon

    For our matrix three, four; four, six, let x have entries x and y. Multiplying out x transpose S x gives three x squared, plus four xy, plus another four xy, plus six y squared. So the energy is three x squared plus eight xy plus six y squared.

  14. Corey

    The diagonal entries give the squared terms, and the two off-diagonal entries contribute the two cross terms. The cross term can be negative if x and y have opposite signs. Positive definiteness means the whole expression still stays positive for every nonzero vector.

  15. Simon

    Geometrically, the graph of that energy is a bowl with its bottom at the origin. The squared terms push it upward, and for this matrix they outweigh the cross term. That bowl picture is why positive definite quadratic forms are so useful.

  16. Corey

    It also connects to optimization. A quadratic energy can be a model for a loss we want to minimize. In a more general least-squares-style expression, a linear term can shift the bowl’s minimum away from the origin, while leaving the bowl’s basic shape intact.

  17. Simon

    In machine learning, loss functions can depend on enormous numbers of variables—perhaps a hundred thousand or more. They need not be simple quadratics; they can include nonlinear terms, and a loss function may not be convex. But minimizing a function is still the central challenge.

  18. Corey

    For a differentiable function, the gradient collects all its first derivatives into a vector. At a point, it indicates the direction of steepest increase, so the negative gradient points downhill. Gradient descent starts from an initial point and moves in that downhill direction.

  19. Simon

    You also need to choose how far to move. That step-size decision is often called a line search: move along the chosen direction, decide where to stop, and then calculate the gradient again at the new point. Repeating that process is gradient descent.

  20. Corey

    Why not use second derivatives to get a more informed step? They can help account for the function’s curvature, but computing them can be costly when there are very many variables. In the setting we’re discussing, methods often rely on first derivatives instead.

  21. Simon

    Gradient descent can also behave poorly when the bowl is long and narrow. If the eigenvalues differ greatly in size, the bowl has a steep direction and a shallow direction. The steepest downhill path can zigzag across the narrow valley, taking many small steps toward the bottom.

  22. Corey

    If the eigenvalues are equal, the bowl is circular. For the identity matrix, the energy is x squared plus y squared. Starting anywhere, the negative gradient points straight toward the center, so the method can travel directly to the minimum in this simple picture.

  23. Simon

    That’s one reason positive definite matrices matter: they describe bowls with a well-defined minimum. But the eigenvalues also tell us about the bowl’s shape, and a large spread between them can make optimization harder.

  24. Corey

    Let’s use the energy test to answer a structural question. If S and T are positive definite, is S plus T positive definite? For any nonzero x, the energy is x transpose S x plus x transpose T x.

  25. Simon

    Each of those two terms is positive, so their sum is positive. Therefore S plus T is positive definite. The energy test makes that conclusion immediate, without having to find determinants or pivots for the sum.

  26. Corey

    What about the inverse of a positive definite matrix S? Its eigenvalues are the reciprocals of S’s eigenvalues. Since the original eigenvalues are positive, their reciprocals are positive too; the inverse is symmetric as well. So S inverse is positive definite.

  27. Simon

    A general product S times M might not be symmetric, so it isn’t automatically a candidate for the positive definite tests we’re using. But an orthogonal change of coordinates gives Q transpose S Q, which is symmetric when S is symmetric.

  28. Corey

    And it remains positive definite. One way to see that is to check its energy: x transpose Q transpose S Q x equals y transpose S y if we set y equal to Qx. For any nonzero x, y is nonzero, so that energy is positive.

  29. Simon

    There’s also an eigenvalue explanation. Because Q is orthogonal, Q transpose is its inverse, so Q transpose S Q is similar to S. Similar matrices have the same eigenvalues, and those are positive for S.

  30. Corey

    Now let’s look at the boundary case: positive semidefinite. Instead of requiring every eigenvalue to be strictly positive, we allow eigenvalues to be zero, while still requiring none to be negative. In energy terms, the quadratic form is nonnegative rather than strictly positive.

  31. Simon

    For example, keep the top-left entry at three and the off-diagonal entries at four, but set the bottom-right entry to sixteen-thirds. The determinant is zero, so one eigenvalue is zero. The trace is twenty-five-thirds, so the other eigenvalue is positive.

  32. Corey

    That makes the matrix positive semidefinite: it’s right on the boundary of the positive definite matrices. A zero eigenvalue means the matrix is singular, so it can’t be positive definite, but it can still have nonnegative energy.

  33. Simon

    A three-by-three matrix of all ones gives another example. It has rank one, so only one eigenvalue is nonzero. Its trace is three, which gives eigenvalues three, zero, and zero—again, positive semidefinite.

  34. Corey

    It also shows why the factorization involving A transpose A is useful. If A is the row vector with entries one, one, one, then A transpose A is exactly the three-by-three matrix of all ones. For any vector x, x transpose A transpose A x equals the squared length of Ax, so it can’t be negative.

  35. Simon

    More generally, a symmetric positive definite matrix can be written as A transpose A with A invertible. That factorization is another test; it makes the energy a squared length, and invertibility ensures the squared length is positive for every nonzero x. For positive semidefinite matrices, the corresponding factor A need not be invertible.

  36. Corey

    So the tests we’ve connected are positive eigenvalues, positive energy, an A transpose A factorization with an invertible factor, positive leading determinants, and positive pivots. For a symmetric matrix, each provides a route to the same conclusion: positive definiteness.

  37. Simon

    And when we relax ‘positive’ to ‘nonnegative,’ zero eigenvalues and zero energy in some directions become possible. That distinction sets us up for what comes next: the singular value decomposition and the ideas that follow from it.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent