title: Error in solve.default(vamos): system is computationally singular: reciprocal condition number
body: <pre><code>y &lt;- sample(1:10,5)
  
  sam&lt;-sample(100:130,20)
  
  x &lt;- matrix(sam,5,4)
  
  # 1a
  
  betaestimator &lt;- function(x,y) {
      b&lt;-  solve(t(x)%*%x)%*%t(x)%*%y
  b
  
  }
  
  
  #1b
  
  covestimator &lt;- function(x,y) {
  
      b&lt;-  solve(t(x)%*%x)%*%t(x)%*%y
    t&lt;-nrow(x)
      k&lt;-ncol(x)
    s &lt;- ((t(y-x%*%b))%*%(y-x%*%b))/(t-k)
    s2 &lt;- matrix (s:s,k,k)
    e &lt;- s2*(solve(t(x)%*%x))
    e
  
  }
  
  
  #1c
  
  ttest &lt;- function (x,y) {
      b&lt;-  solve(t(x)%*%x)%*%t(x)%*%y
    t&lt;-nrow(x)
      k&lt;-ncol(x)
    s &lt;- ((t(y-x%*%b))%*%(y-x%*%b))/(t-k)
    s2 &lt;- matrix (s:s,k,k)
    e &lt;- s2*(solve(t(x)%*%x))
  
  estatt&lt;-matrix(0,k,1)
     for (i in 1:k ) {
  estatt[i,1] = b[i,1]*e[i,i]
  
  }
  estatt
  }
  
  
  #ESTATISTICA t TA DANDO MT BAIXO
  
  
  #2.1
  
  
  b1&lt;-0.121
  b2&lt;-0.190
  t&lt;-23
  c2&lt;-2
  theta&lt;-0.6
  x0&lt;-rnorm(1,c2/(1-theta),1/(1-theta^2))
  
  
  
  
  set.seed(1210686)
  normais&lt;-c(rnorm(23,0,1))
  
  
  c&lt;-0:22
  c[1]&lt;-x0
  
  for (i in 2:23) {
  c[i] = 2 + theta*c[i-1] + normais[i]
  }
  
  #2.2
  
  epsilon&lt;-c(rnorm(23,0,1))
  
  
  #2.3
  y&lt;-0:22
  for (i in 1:23) {
  y[i] = b1 + b2*c[1] + epsilon[i]
  }
  
  ytransposto &lt;- t(y)
  tudoum&lt;-matrix(1,1,23)
  
  novax &lt;- matrix(rbind(tudoum,c),2,23)
  novax
  vamos &lt;- (t(novax)%*%novax)
  vamos
  solve(vamos)
  </code></pre>
  
  <p>When I try to solve this matrix, it gives me the error:</p>
  
  <pre><code>Error in solve.default(vamos): system is computationally singular: reciprocal condition number = 1.71139e-19
  Error in solve.default(vamos): system is computationally singular: reciprocal condition number = 1.71139e-19
  </code></pre>
  
  <p>I can't change the numbers, because this is part of a class project my teacher gave me. Thanks!</p>