title: Faster way of finding least-square solution for large matrix
body: <p>I want to find the least-square solution of a matrix and I am using the numpy <code>linalg.lstsq</code> function;</p>
  
  <pre><code>weights = np.linalg.lstsq(semivariance, prediction, rcond=None)
  </code></pre>
  
  <p>The dimension for my variables are;</p>
  
  <p><code>semivariance</code> is a float of size 5030 x 5030</p>
  
  <p><code>prediction</code> is a 1D array of length 5030</p>
  
  <p>The problem I have is it takes approximately 80sec to return the value of <code>weights</code> and I have to repeat the calculation of <code>weights</code> about 10000 times so the computational time is just elevated. </p>
  
  <p>Is there a faster way/pythonic function to do this? </p>