-1

This error comes up when I am dividing by the matrix inverse.

 Error in solve.default(x) : 
  system is computationally singular: reciprocal condition number = 6.85861e-18 ```

What are the ways to solve this? I am using the matrix.inverse function to find the inverse.

Jason_Leto
  • 55
  • 5
  • Hello, welcome to stackoverflow. This message means that your matrix is very (very !) badly contionned, and that numerically computing its inverse would make little sense (see `?rcond`). You might want to use instead the pseudoinverse. – Vincent Guillemot Aug 22 '20 at 12:57

1 Answers1

0

Given a matrix M, I guess it would be safe to use ginv from package MASS to compute the inverse if you want to avoid the error in your post, e.g.,

MASS::ginv(M)
ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81