8
$\begingroup$

I have a symmetric matrix A. How do I compute a matrix B such that $B^tB=A$ where $B^t$ is the transpose of $B$. I cannot figure out if this is at all related to the square root of $A$.

I've gone through wikimedia links of square root of a matrix.

  • 3
    http://en.wikipedia.org/wiki/Cholesky_factorization2010-08-15

2 Answers 2

12

As J. M. says, you need your matrix $A$ to be positive definite. Since $A$, being symmetric, is always diagonalizable, this is the same as saying that it has non-negative eigenvalues. If this is the case, you can adapt alex's comment almost literally for the real case: as we've said, $A$ is diagonalizable, but, also, there exists an orthonormal base of eigenvectors of $A$. That is, there is an invertible matrix $S$ and a diagonal matrix $D$ such that

$$ D = SAS^t , \quad \text{with} \quad SS^t = I \ . $$

Since

$$ D = \mathrm{diag} (\lambda_1, \lambda_2, \dots , \lambda_n) \ , $$

is a diagonal matrix and has only non-negative eigenvalues $\lambda_i$, you can take its square root

$$ \sqrt{D} = \mathrm{diag} (\sqrt{\lambda_1}, \sqrt{\lambda_2}, \dots , \sqrt{\lambda_n} ) \ , $$

and then, on one hand, you have:

$$ \left( S^t \sqrt{D} S \right)^2 = \left( S^t \sqrt{D} S\right) \left(S^t \sqrt{D} S \right) = S^t \left( \sqrt{D}\right)^2 S = S^t D S = A \ . $$

On the other hand, $S^t \sqrt{D} S$ is a symmetric matrix too:

$$ \left( S^t \sqrt{D} S \right)^t = S^t (\sqrt{D})^t S^{tt} = S^t \sqrt{D^t} S = S^t \sqrt{D} S \ , $$

so you have your $B = S^t \sqrt{D} S$ such that $B^t B = A$.

2

What you apparently want here is the Cholesky decomposition, which factors a matrix A into $BB^T$ where $B$ is a triangular matrix. However, this only works if your matrix is positive definite.

  • 3
    The times between this and the comment are miraculously close :)2010-08-15
  • 0
    if the matrix is not positive definite, then is there another property I could use?2010-08-15
  • 1
    if the matrix is not a positive definite, there may not be a real solution. for example, the $1 \times 1$ matrix $A=-1$ does not have a real square root.2010-08-15
  • 1
    On the other hand, if you are OK with complex answers, then if $A$ is diagonalized as $A=U D U^{T}$ with diagonal $D$ and unitary $U$, then take $B=U D^{1/2} U^{T}$. $B$ will have complex entries, since some of the entries of $D$ will be negative. However, $B B^T = U D U^T = A$.2010-08-15
  • 0
    Even the "true matrix square root" requires that the eigenvalues of a general matrix A should not lie on the negative real axis for it to have a unique ("principal") square root. See http://books.google.com/books?id=S6gpNn1JmbgC&pg=PA133 for instance.2010-08-15
  • 0
    To add another note, since it apparently does not get stressed enough in practice: the relation between the Cholesky decomposition and positive definiteness is "if and only if". If the decomposition can be computed, the matrix is positive definite and vice-versa.2010-08-15
  • 0
    another related question - if i now assume matrix is symmetric positive definite, and I have diagonalized the matrix as Q DQ^T, is there a way I can convert this quickly to Cholesky decomposition?2010-08-16
  • 0
    Yes: define $L=Q D^{1/2}$, then $A=L L^T$.2010-08-16
  • 1
    alex - I don't think Q D^{1/2} Q going to be triangular matrix. take for example A = ((2,-2),(-2,5))2010-08-16
  • 0
    Sorry, I didn't realize you wanted your $L$ to be lower triangular.2010-08-16
  • 0
    One possibility to generate the Cholesky triangle from $\sqrt{D}Q^T$ is to perform a QR decomposition on it. On the other hand, doing a flop count on this process shows that you're better off generating the Cholesky triangle ab initio!2010-08-16