1

I have calculated that the determinant of a matix is not equal to 0, which means the matix is non-singular. But when passing it to the ols function, I still get an error : input singular. Any reason?

Eva Gao
  • 402
  • 1
  • 7

1 Answers1

1

Due to the way floats are stored, you cannot use ā€œv == 0ā€ (ā€œvā€œ means a float) to check if a float is 0. You can solve your problem by the method Factor Analysis. To avoid generating singular matrix, you should prevent linear correlation between variables. The common practice is orthogonal transformation first. In addition, you can refer to DolphinDB's eqFloat for details about float comparison.