3
$\begingroup$

I have a matrix $\eta$ that should be Positive Definite but it is not. Is there a numerical method to gently push my non-Positive Definite matrix back into the set of Positive Definite matrices?

Background

I need to evaluate the following integral: $$ I=\int_{\mathcal{D}}\phi(\vec{x})\psi(\vec{x}) d\vec{x}^2 $$ where both functions are real and my vector notation is just implying integration in a 2D plane.

I expand my functions into a set of basis functions ($B_{j}(\vec{x})$) that are not orthogonal. Why not orthogonal? Because $\mathcal{D}$ is arbitrary and once a I have a $\mathcal{D}$ I only want to spend computer time once to do numerical integrations but be able to calculate an unlimited number of $I$ values quickly. Also some times I'm given the basis functions that I must work with.

I write: $$ \phi(\vec{x})\approx \sum_{j=1}^{n} a_{J} B_{j}(\vec{x}) $$ and $$ \psi(\vec{x})\approx \sum_{j=1}^{n} b_{J} B_{j}(\vec{x}) $$ This lets me think of my functions as vectors: $$ \phi(\vec{x})\rightarrow \left^{T}=\vec{\phi} $$ $$ \psi(\vec{x})\rightarrow \left^{T}=\vec{\psi} $$ I can now separate my geometry ($\mathcal{D}$) from the instance of my functions. $$ I\approx\sum_{i=1}^{n}\sum_{j=1}^{n} a_{i} b_{j} \int_{\mathcal{D}} B_{i}(\vec{x}) B_{j}(\vec{x}) d\vec{x}^2 $$ Notice because of my lack of orthogonality I do not get those beautiful Kronecker delta things so I'm left with double sums. I can rewrite as: $$ I\approx \vec{\phi}^{T}\eta\vec{\psi} $$ where $$ \eta_{i,j}=\int_{\mathcal{D}} B_{i}(\vec{x}) B_{j}(\vec{x}) d\vec{x}^2 $$

Some properties to keep in mind:

  • $\eta$ is symmetric $\eta^{T}=\eta$
  • $\eta$ is of full rank but the singular values span many orders of magnitude.
  • $\eta$ is Positive Definite in theory (Challenge this statement if you think it is wrong.)

The Problem

Because of numerical integration errors $\eta$ is not Positive Definite but it does have full rank.

The Question

Is there a numerical method to gently push my non-Positive Definite matrix back into the set of Positive Definite matrices?

  • 1
    Is diagonalizing it and replacing the negative eigenvalues an option?2012-10-13
  • 0
    I tried taking the absolute value of the eigen-values then re-building but it remained non-Positive Definite. I also made sure that my eigen-vectors were real.2012-10-13
  • 1
    Then there's more wrong in your code than just integration errors. A real symmetric matrix with positive eigenvalues is almost by definition positive-definite.2012-10-13
  • 0
    Yes I agree something somewhere is going bad most likely in my code. I have played with the essence of small ($3\times 3$) positive-definite matrices testing everything I would expect to be true and I get what I expect. But when I work with my real problem that has a $408\times 408$ and this is a small case, I get unexpected results. I do not what to drag you or anyone into the depths of my code but I'm looking for some silly things to check and think about.2012-10-14
  • 0
    It's either an outright error or a rounding problem. I suspect the basis functions that are being forced upon you are nearly linearly dependent? You might try orthogonalizing them first, but I suspect that might lead to the same rounding problems. If you can get a hold of J.M., he might be able to help; he knows quite a lot about such things.2012-10-14
  • 0
    Thank you @joriki I have parallelized my computation of my big matrix to speed up testing ideas and I have formalized my testing. I'm using _Mathematica_ so I'm going to trust its numerical results are as good as I can get. I think the bottom line is I'm stuck with a severely poorly conditioned matrix. I get 408 eigenvalues but I get 405 singular values. My determent is $10^{-1194}$ However, I do get, as you pointed out, a Positive Definite matrix when I re-biuld with $|\lambda|$2012-10-14

0 Answers 0