Matrix multiplied by inverse matrix does not reproduce identity matrix

It’s nearly symmetric. Because of the imprecision inherent in floating point numbers, it’s best to use approximate comparisons like this:

julia> varc ≈ varc'
true

The approximate equality symbol can be typed in the REPL with \approx<TAB>, or you can use the equivalent function call: isapprox(varc, varc'). If you know your matrix is structurally symmetric, you can use the Symmetric wrapper type:

julia> Symmetric(varc)
4×4 Symmetric{Float64, Matrix{Float64}}:
  1.1275  -0.0000  -0.0000  -0.0000
 -0.0000  -0.0000  -0.0000  -0.0000
 -0.0000  -0.0000  -0.0000  -0.0000
 -0.0000  -0.0000  -0.0000  -0.0000

julia> issymmetric(ans)
true
5 Likes