2
$\begingroup$

I'd like to define a symbolic real positive definite matrix. For the 2 x 2 example, I thought I could define four real variables using $Assumptions = {a,b,c,d} \esc elem \esc Reals. And then define the positive definite matrix using MatrixPD = Transpose[{{a,b},{c,d}}].{{a,b},{c,d}}].

However PositiveDefiniteMatrixQ[MatrixPD] returns False. Is this because, I have not defined the assumptions sufficiently to guarantee that MatrixPD will be positive definite, or is it because of a limitation of PositiveDefiniteMatrixQ.

I also tried the following. The manaul includes the following symbolic example PositiveDefiniteMatrixQ[{{1, a}, {-Conjugate[a], 1}}] Since I had defined "a" to be real, I assumed I could modify this to be PositiveDefiniteMatrixQ[{{1, a}, {-a, 1}}] However, this returned False. Am I not asserting the assumption that "a" is real properly or is something else going wrong?

$\endgroup$
6
  • 2
    $\begingroup$ Assumptions are only taken into consideration by a few functions and not all; I doubt that PositiveDefiniteMatrixQ does. The docs for PositiveDefiniteMatrixQ say that it returns true only for explicitly positive definite matrices, which I take to mean numerical ones. $\endgroup$
    – MarcoB
    Commented Feb 22, 2021 at 20:40
  • 1
    $\begingroup$ @MarcoB Thanks this is helpful. Another step, I notice is that the use of Transpose[A].A requires that A be invertible. So my question reduces to generating a symbolic invertible matrix. $\endgroup$
    – Kenric
    Commented Feb 22, 2021 at 21:01
  • 3
    $\begingroup$ I think your assumptions allows for semi definite matrices: E.g. {a, b, c, d}={2, 3, 4, 6}; m={{20, 30}, {30, 45}} $\endgroup$ Commented Feb 22, 2021 at 21:03
  • 1
    $\begingroup$ @DanielHuber this is a helpful example. I see that {{2,3},{4,6}} is not invertible, so indeed this is a missing requirement. Do you have a suggestion for generating a symbolic invertible matrix. $\endgroup$
    – Kenric
    Commented Feb 22, 2021 at 21:07
  • 1
    $\begingroup$ I'm not sure how general this is but one approach to generating an invertible matrix is to generate lower and upper matrices. Then A = LU is invertible. $\endgroup$
    – Kenric
    Commented Feb 22, 2021 at 21:13

1 Answer 1

5
$\begingroup$

Any positive real matrix has positive eigenvalues, so you can construct the matrix by:

n = 2;
diag = Array[e, n];
b = RandomReal[{-1, 1}, {n, n}];
sym = FullSimplify[Transpose[b] . DiagonalMatrix[diag] . b]

So sym is the general form of the matrix. To be positive definite, you then need ensure only that the n elements of diag (in the n=2 case, this is e[1] and e[2]) are positive.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.