Error in solve.default(object$hessian) : system is computationally singular: reciprocal condition number = 2.53258e-20

Hi

I am trying to draw 1000 samples of data with a size of approximately 4000 )ِ (Exam data), and for each sample the difficulty factor, discrimination and guessing is calculated in order to compare all samples in these calculations, but I encountered the following problem:

Error in solve.default(object$hessian) : system is computationally singular: reciprocal condition number = 2.53258e-20

Can anyone tell me what the problem is? and what is the solution?

It sounds like you have some collinearity in your sample. That is, you have a column that is nearly identical to another column. For example, notice the third column in this matrix is nearly identical to the second column:

> X <- matrix(c(1,2,3,
+               4,5,6,
+               4,5,6.00000000000001), ncol = 3)
> solve(X)
Error in solve.default(X) : 
  system is computationally singular: reciprocal condition number = 1.55431e-16

If we wanted to "solve" despite the collinearity we could use QR decomposition as follows:

> qr.coef(qr(X), diag(3))
           [,1]       [,2]       [,3]
[1,] -0.9444444 -0.1111111  0.7222222
[2,]  0.4444444  0.1111111 -0.2222222
[3,]         NA         NA         NA

But notice the rows of NAs. So it ran without error but could not actually solve for the collinear column.

To be honest, I have no idea what you're actually doing according to your description. It's pretty vague. I'm just making a guess at what's causing the error.

Many thanks clayford, what you explained was helpful, and seems that collinearity was the cause of the problem that I faced.