# Stability of matrix equations in MATLAB

Is there a method to check for unconditional stability or positive-definiteness of large matrices in MATLAB?

For example, I know that matrices with property M (positive main diagonal elements and negative off-diagonal elements, with the main diagonal elements in each row or column being larger than the summation of off-diagonal elements) result in an unconditionally stable system of equations. But I cannot decide for other matrices.

• Is the matrix symmetric? If so, the fastest, most conclusive and the most numerically stable way is simply to attempt to compute its Cholesky factorization. – Richard Zhang May 20 '16 at 0:22
• What is unconditional stability of a matrix or of a system of linear equations? It is not standard terminology as far as I know. – Federico Poloni May 20 '16 at 13:35

In general, your best bet is to understand where your matrix came from and be able to show that it is theoretically positive definite. The computational approaches to showing that a matrix is positive definite (including eigenvalues, Cholesky factorization, and checking determinants of principal minors) are all impractical for large sparse matrices.

If your matrices are dense and of merely medium size (you can easily fit them into memory) then checking for symmetry and then computing the Cholesky factorization is probably the most practical way to check for positive definiteness.

I suspect that you also want a method which is not to computational expensive. So depending on whether or not you think that this is not too computational expensive you could use the following. Look at whether the determinants of each (upper left) sub-matrix is bigger than zero.

With upper-left submatrices I mean the following; for $A\in \mathbb{R}^n$ then,

$$\det\left(A[1,\cdots,k;1,\cdots,k]\right) > 0\quad \forall\; k=1,\cdots,n.$$

This also has the advantage that it can be terminated whenever you encounter a determinant which is smaller or equal to zero. Depending on how many CPU core you have available you could speed this up by do this in parallel with parfor. Only I do not know if you can still terminate when you encounter a bad determinant.

• Your "not too computational expensive" method is $O(n^4)$... – Federico Poloni May 20 '16 at 13:36