# Making a real matrix positive definite by replacing nonzero and nondiagonal entries with arbitrary nonzero reals

Let $A$ be real square matrix.

Let $\mathcal{F}(A)$ be the set of real matrices $A'$ of the same size such that $A'_{ii}=A_{ii}$ for all $i$, and for all $i,j$, $A_{ij}=0\Rightarrow A'_{ij}=0 \land A_{i,j} \ne 0 \implies A'_{i,j} \ne 0$: in other words, obtained from $A$ by modifying nonzero nondiagonal entries.

Q1 What are sufficient conditions for $A$ s.t. exists a positive definite $A'$ in $\mathcal{F}(A)$?

Since there are several definitions of positive definite, we don't require neither $A$ or $A'$ to be symmetric.

In practice this is possible for some $A$.

Partial answers are welcome. The definition of positive definite from mathworld

$M$ is positive definite if for all nonzero real vectors $x$, $x^T M x >0$.

• Please indicate what you mean by positive definite (I understand it means $X^tAX>0$ for every nonzero column vector $X$?)
– YCor
Dec 31, 2015 at 11:02
• @YCor Exactly, will edit soon, citing mathworld (wikipedia requires symmetric).
– joro
Dec 31, 2015 at 11:20

The answer is quite boring... Necessary and sufficient conditions are $A_{ii}>0$ for each $i$. In this case, let $B_\varepsilon$ the matrix with entries $$(B_\varepsilon)_{ij} = \begin{cases} A_{ij} & i=j,\\ \varepsilon & i\neq j, A_{ij}\neq 0,\\ 0 & i\neq j, A_{ij}=0. \end{cases}$$ The matrix $B_0$ is diagonal and posdef, so for any sufficiently small value of $\varepsilon$ the matrix $B_\varepsilon$ (which belongs to $\mathcal{F}(A)$) is posdef, too, since positive definiteness is an open condition.

On the other hand, if $A_{ii}\leq 0$ for some $i$ there is no hope, since for each $A'\in\mathcal{F}(A)$ we have $x^\top A'x \leq 0$ when $x$ is the vector $e_i$ of the canonical basis.

• Thanks. Ycor misquoted my definition. I edited: $A_{i,j} \ne 0 \implies A'_{i,j} \ne 0$ (I had this in wording). Does your answer still applies?
– joro
Dec 31, 2015 at 11:22
• @Joro Yes. Just put epsilons instead of zeros in the entries where you need nonzeros. Any sufficiently small modification of $D$ is posdef, since posdefness is an open condition. Dec 31, 2015 at 11:26
• Thank you. I suggest to edit, so I accept your answer (The title doesn't accept zeros and I had explicitly nonzero, but Ycor's edit missed that).
– joro
Dec 31, 2015 at 11:37
• I discarded the condition $A_{ij}\neq 0\Rightarrow A'_{ij}\neq 0$ because it does not affect the existence of a positive-definite matrix in $F(A)$, by the openness condition Federico mentioned.
– YCor
Dec 31, 2015 at 11:41
• Happy New year celebration!
– joro
Dec 31, 2015 at 11:48