Is this a reasonable method of numerically comparing two matrix functions?

64 Views Asked by At

I am currently trying to compare two matrices with elements which are too complicated for me to algebraically show that they are equal element wise and I decided to try the following approach:

Suppose I have two matrix functions $A(t)$ and $B(t)$ whose entries are somewhat complicated, but "nice" differentiable functions.

If I use a computer algebra system such as MATLAB and evaluate

$$\det(A(t)-B(t))$$

at a thousand points between $t = [0,10]$. If the maximum of the determinant over that interval is $4*10^{-31}$, is that enough for me to be reasonably sure $A(t) = B(t)$ on $[0,10]$? I tried searching and I couldn't find examples of using the determinant as a measurement for error.

Edit: I should point out that these matrices are never upper, or lower triangular such as this:

$$A(t)= \begin{bmatrix} 0&t\\ 0&0 \end{bmatrix}, B(t) = \begin{bmatrix} 0&2t\\ 0&0 \end{bmatrix}$$ but even if they were, is there any reasonable way to fix this method without simply comparing the matrices element wise?

1

There are 1 best solutions below

4
On BEST ANSWER

If $\det(M)=0$, then we can only say that $M$ is singular, but $M$ itself could be very much non-zero.

However, if the norm of the matrix $M=A-B$ is zero, then $M=0$. So perhaps look at $\mathrm{tr}(M^\top M)$, assuming that $M$ is real (otherwise use conjugate transpose).

In terms of numerical error, if you have good reason to suppose they are equal and no reason to suppose that there may be a conspiracy going on, it would be rather suggestive (assuming that you saw the same values with the norm).