Post · 4 min read· pp. 701–703

Diagonally Perturbing a Symmetric Matrix to Make It Positive Definite

Suppose AA is a matrix that is symmetric but not positive definite. What is the best way to perturb the diagonal to make AA positive definite? We want to compute a vector dd such that

A(d)=A+D,D=diag(d),\notag A(d) = A + D, \quad D = \mathrm{diag}(d),

is positive definite. Since the positive definite matrices form an open set there is no minimal dd, so we relax the requirement to be that AA is positive semidefinite. The perturbation DD needs to make any negative eigenvalues of AA become nonnegative. We will require all the entries of dd to be nonnegative. Denote the eigenvalues of AA by λn(A)≤λn−1(A)≤⋯≤λ1(A)\lambda_n(A) \le \lambda_{n-1}(A) \le \cdots \le \lambda_1(A) and assume that λn(A)<0\lambda_n(A) < 0.

A natural choice is to take DD to be a multiple of the identity matrix. For di≡δd_i \equiv \delta, A(d)A(d) has eigenvalues λi+δ\lambda_i + \delta, and so the smallest possible δ\delta is δ=−λn(A)\delta = - \lambda_n(A). This choice of DD shifts all the diagonal elements by the same amount, which might be undesirable for a matrix with widely varying diagonal elements.

When the diagonal entries of AA are positive another possibility is to take di=αaiid_i = \alpha a_{ii}, so that each diagonal entry undergoes a relative perturbation of size α\alpha. Write DA=diag(aii)D_A = \mathrm{diag}(a_{ii}) and note that C=DA−1/2ADA−1/2C = D_A^{-1/2}A D_A^{-1/2} is symmetric with unit diagonal. Then

A+αDA=DA1/2(C+αI)DA1/2.\notag A + \alpha D_A = D_A^{1/2}(C + \alpha I)D_A^{1/2}.

Since A+αDAA + \alpha D_A is positive semidefinite if and only if C+αIC + \alpha I is positive semidefinite, the smallest possible α\alpha is α=−λn(C)\alpha = -\lambda_n(C).

More generally, we can treat the did_i as nn independent variables and ask for the solution of the optimization problem

min⁡∥d∥  subject to  A+diag(d) positive semidefinite, d≥0.(†)\notag \min \|d\| ~~\mathrm{subject~to}~~ A + \mathrm{diag}(d) ~\mathrm{positive~semidefinite}, ~d \ge 0. \qquad(\dagger)

Of particular interest are the norms ∥d∥1=∑idi=trace(D)\|d\|_1 = \sum_i d_i = \mathrm{trace}(D) (since d≥0)d\ge0) and ∥d∥∞=max⁡idi\|d\|_\infty = \max_i d_i.

If A+DA+D is positive semidefinite then from standard eigenvalue inequalities,

0≤λn(A+D)≤λn(A)+λ1(D),\notag 0 \le \lambda_n(A+D) \le \lambda_n(A) + \lambda_1(D),

so that

max⁡idi≥−λn(A).\notag \max_i d_i \ge -\lambda_n(A).

Since di≡−λn(A)d_i \equiv -\lambda_n(A) satisfies the constraints of (†)(\dagger), this means that this dd solves (†)(\dagger) for the ∞\infty-norm, though the solution is obviously not unique in general.

For the 11– and 22-norms, (†)(\dagger) does not have an explicit solution, but it can be solved by semidefinite programming techniques.

Another approach to finding a suitable DD is to compute a modified Cholesky factorization. Given a symmetric AA, such a method computes a perturbation EE such that A+E=RTRA + E = R^TR for an upper triangular RR with positive diagonal elements, so that A+EA + E is positive definite. The methods of Gill, Murray, and Wright (1981) and Schnabel and Eskow (1990) compute a diagonal EE. The cost in flops is essentially the same as that of computing a Cholesky factorization (n3/3n^3/3) flops), so this approach is likely to require fewer flops than computing the minimum eigenvalue or solving an optimization problem, but the perturbations produces will not be optimal.

Example

We take the 5×55\times 5 Fiedler matrix

text
>> A = gallery('fiedler',5)
A =
     0     1     2     3     4
     1     0     1     2     3
     2     1     0     1     2
     3     2     1     0     1
     4     3     2     1     0

The smallest eigenvalue is −5.2361-5.2361, so A+DA+D is positive semidefinite for D1=5.2361ID_1 = 5.2361I. The Gill–Murray–Wright method gives DGMWD_{\mathrm{GMW}} with diagonal elements

text
2.0000e+01   4.6159e+00   1.3194e+00   2.5327e+00   1.0600e+01

and has λ5(A+DGMW)=0.5196\lambda_5(A+D_{\mathrm{GMW}}) = 0.5196 while the Schnabel–Eskow method gives DSED_{\mathrm{SE}} with diagonal elements

text
6     6     6     6     6

and has λ5(A+DSE)=0.7639\lambda_5(A+D_{\mathrm{SE}}) = 0.7639. If we increase the diagonal elements of D1D_1 by 0.5 to give comparable smallest eigenvalues for the perturbed matrices then we have

∥d∥∞\Vert d\Vert_{\infty}∥d∥1\Vert d \Vert_1
Shift5.236126.180
Gill-Murray-Wright20.00039.068
Schnabel–Eskow6.00030.000

References