Post · 6 min read· pp. 698–700

When Does Thresholding Preserve Positive Definiteness?

Does a symmetric positive definite matrix remain positive definite when we set one or more elements to zero? This question arises in thresholding, in which elements of absolute value less than some tolerance are set to zero. Thresholding is used in some applications to remove correlations thought to be spurious, so that only statistically significant ones are retained.

We will focus on the case where just one element is changed and consider an arbitrary target value rather than zero. Given an n×nn\times n symmetric positive definite matrix AA we define A(t)A(t) to be the matrix resulting from adding tt to the (i,j)(i,j) and (j,i)(j,i) elements and we ask when is A(t)A(t) positive definite. We can write

A(t)=A+t(eiejT+ejeiT)≡A+tEij,\notag A(t) = A + t(e_i^{}e_j^T + e_j^{}e_i^T) \equiv A + tE_{ij},

where eie_i is the iith column of the identity matrix. The perturbation EijE_{ij} has rank 22, with eigenvalues −1-1, 11, and 00 repeated n−2n-2 times. Hence we can write EijE_{ij} in the form Eij=ppT−qqTE_{ij} = pp^T - qq^T, where pTp=qTq=1p^Tp = q^Tq = 1 and pTq=0p^Tq = 0. Adding ppTpp^T to AA causes each eigenvalue to increase or stay the same, while subtracting qqTqq^T decreases or leaves unchanged each eigenvalue. However, more is true: after each of these rank-11 perturbations the eigenvalues of the original and perturbed matrices interlace, by Weyl’s theorem. Hence, with the eigenvalues of AA ordered as λn(A)≤⋯≤λ1(A)\lambda_n(A) \le \cdots \le \lambda_1(A), we have (Horn and Johnson, Cor. 4.3.7)

λn(A(t))≤λn−1(A),λi+1(A)≤λi(A(t))≤λi−1(A),i=2 ⁣:n−1,λ2(A)≤λ1(A(t)).\notag \begin{aligned} \lambda_n(A(t)) &\le \lambda_{n-1}(A), \\ \lambda_{i+1}(A) &\le \lambda_i(A(t)) \le \lambda_{i-1}(A), \quad i = 2\colon n-1, \\ \lambda_2(A) &\le \lambda_1(A(t)). \end{aligned}

Because AA is positive definite these inequalities imply that λn−1(A(t))≥λn(A)>0\lambda_{n-1}(A(t)) \ge \lambda_n(A) > 0, so A(t)A(t) has at most one negative eigenvalue. Since det⁡(A(t))\det(A(t)) is the product of the eigenvalues of A(t)A(t) this means that A(t)A(t) is positive definite precisely when det⁡(A(t))>0\det(A(t)) > 0.

There is a simple expression for det⁡(A(t))\det(A(t)), which follows from a lemma of Chan (1984), as explained by Georgescu, Higham, and Peters (2018):

det⁡(A(t))=det⁡(A)(1+2tbij+t2(bij2−biibjj)),\notag \det(A(t)) = \det(A)\big(1+ 2t b_{ij} + t^2(b_{ij}^2-b_{ii}b_{jj})\big),

where B=A−1B = A^{-1}. Hence the condition for A(t)A(t) to be positive definite is

qij(t)=1+2tbij+t2(bij2−biibjj)>0.\notag q_{ij}(t) = 1 + 2t b_{ij} + t^2(b_{ij}^2-b_{ii}b_{jj}) > 0.

We can factorize

qij(t)=(t(bij−biibjj)+1)(t(bij+biibjj)+1),\notag q_{ij}(t) = \Bigl( t\bigl(b_{ij} - \sqrt{b_{ii}b_{jj}}\bigr) + 1 \Bigr) \Bigl( t\bigl(b_{ij} + \sqrt{b_{ii}b_{jj}}\bigr) + 1 \Bigr),

so qij(t)>0q_{ij}(t) > 0 for

t∈(−1biibjj+bij,1biibjj−bij)=:Iij,\notag t\in \left( \displaystyle\frac{-1}{ \sqrt{b_{ii}b_{jj}} + b_{ij} }, \displaystyle\frac{1}{ \sqrt{b_{ii}b_{jj}} - b_{ij} } \right) =: I_{ij},

where the endpoints are finite because BB, like AA, is positive definite and so ∣bij∣<biibjj|b_{ij}| < \sqrt{b_{ii}b_{jj}}.

The condition for AA to remain positive definite when aija_{ij} is set to zero is qij(−aij)>0q_{ij}(-a_{ij}) > 0, or equivalently −aij∈Iij-a_{ij} \in I_{ij}. To check either of these conditions we need just bijb_{ij}, biib_{ii}, and bjjb_{jj}. These elements can be computed without computing the whole inverse by solving the equations Abk=ekAb_k = e_k for k=i,jk = i,j, for the kkth column bkb_k of BB, making use of a Cholesky factorization of AA.

As an example, we consider the 4×44\times 4 Lehmer matrix, which has (i,j)(i,j) element i/ji/j for i≥ji \ge j:

A=[1121314121231213231341412341].\notag A = \begin{bmatrix} 1 & \frac{1}{2} & \frac{1}{3} & \frac{1}{4} \\[3pt] \frac{1}{2} & 1 & \frac{2}{3} & \frac{1}{2} \\[3pt] \frac{1}{3} & \frac{2}{3} & 1 & \frac{3}{4} \\[3pt] \frac{1}{4} & \frac{1}{2} & \frac{3}{4} & 1 \end{bmatrix}.

The smallest eigenvalue of AA is 0.2080.208. Any off-diagonal element except the (2,4)(2,4) element can be zeroed without destroying positive definiteness, and if the (2,4)(2,4) element is zeroed then the new matrix has smallest eigenvalue −0.0249-0.0249. For i=2i=2 and j=4j=4, the following plot shows in red λmin⁡(A(t))\lambda_{\min}(A(t)) and in blue q24(t)q_{24}(t); the black dots are the endpoints of the closure of the interval I24=(−0.453,0.453)I_{24} = (-0.453,0.453) and the vertical black line is the value −a24-a_{24}. Clearly, −a24-a_{24} lies outside I24I_{24}, which is why zeroing this element causes a loss of positive definiteness. Note that I24I_{24} also tells us that we can increase a24a_{24} to any number less than 0.9530.953 without losing definiteness.

pdplot_lehmer.jpg

Given a positive definite matrix and a set SS of elements to be modified we may wish to determine subsets (including a maximal subset) of SS for which the modifications preserve definiteness. Efficiently determining these subsets appears to be an open problem.

In practical applications thresholding may lead to an indefinite matrix. Definiteness must then be restored to obtain a valid correlation matrix. One way to do this is to find the nearest correlation matrix in the Frobenius norm such that the zeroed elements remain zero. This can be done by the alternating projections method with a projection to keep the zeroed elements fixed. Since the nearest correlation matrix is positive semidefinite, it is also desirable to to incorporate a lower bound δ>0\delta > 0 on the smallest eigenvalue, which corresponds to another projection. Both these projections are supported in the algorithm of Higham and Strabić (2016), implemented in the code at https://github.com/higham/anderson-accel-ncm. For the Lehmer matrix, the nearest correlation matrix with zero (2,4)(2,4) element and eigenvalues at least δ=0.01\delta = 0.01 is (to four significant figures)

[10.49460.34030.24450.494610.643900.34030.643910.72660.244500.72661].\notag \begin{bmatrix} 1 & 0.4946 & 0.3403 & 0.2445 \\ 0.4946 & 1 & 0.6439 & 0 \\ 0.3403 & 0.6439 & 1 & 0.7266 \\ 0.2445 & 0 & 0.7266 & 1 \end{bmatrix}.

A related question is for what patterns of elements that are set to zero is positive definiteness guaranteed to be preserved for all positive definite AA? Clearly, setting all the off-diagonal elements to zero preserves definiteness, since the diagonal of a positive definite matrix is positive. Guillot and Rajaratnam (2012) show that the answer to the question is that the new matrix must be a symmetric permutation of a block diagonal matrix. However, for particular AA this restriction does not necessarily hold, as the Lehmer matrix example shows.

References