title: auto.arima with xreg: Error in solve.default(res$hessian * n.used, A) : Lapack routine dgesv: system is exactly singular: U[1,1] = 0
body: <p>I am trying to fit a dynamic auto.arima model with xreg regression variables.
  When I try to run the code, I get the following error:
  Error in solve.default(res$hessian * n.used, A) : 
    Lapack routine dgesv: system is exactly singular: U[1,1] = 0</p>
  
  <p>Here is the code that results in the error:</p>
  
  <pre><code>library(forecast)
  
  v1 &lt;- c(1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  v2 &lt;- c(0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  v3 &lt;- c(1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  v4 &lt;- c(1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  
  dynamicmatrix &lt;- data.matrix(cbind(v1,v2,v3,v4))
  dynamicmatrix
  
  ts &lt;- ts(dynamicmatrix[,1], start=c(2036,2))
  dynamicmatrix &lt;- data.matrix(dynamicmatrix[,-1])
  fit &lt;- auto.arima(ts, xreg=dynamicmatrix[])
  </code></pre>
  
  <p>Does someone know what might be the problem that causes this error and how I could fix it?</p>
  
  <p>Thank you,
  Niels</p>