title: Error while using stastmodels' WLS: SVD did not converge
body: <p>I've written an algorithm for a cascaded boosting classifier using WLS (weighted least squares regression) in statsmodels, and have been able to successfully run it a few times. I used it with a few hundred images and all was fine.</p>
  
  <p>However, I'm now using it to train a model from approximately 4000 images.
  Now I'm getting the following error:</p>
  
  <pre><code>MKL ERROR: Parameter 4 was incorrect on entry to DLASCL.
  Traceback (most recent call last):
    File "C:\Users\app\Documents\Python Scripts\gbc_carclassify.py", line 95, in &lt;module&gt;
      gentlebooster.train(X_train,y_train,100)
    File "C:\Users\app\Documents\Python Scripts\gentleboost_c_class.py", line 103, in train
      temp_g = sm.WLS(y1, self.X, w).fit()  # Step 2(a)(ii)
    File "C:\Users\app\Anaconda\lib\site-packages\statsmodels\regression\linear_model.py", line 127, in fit
      self.pinv_wexog = pinv_wexog = np.linalg.pinv(self.wexog)
    File "C:\Users\app\Anaconda\lib\site-packages\numpy\linalg\linalg.py", line 1574, in pinv
      u, s, vt = svd(a, 0)
    File "C:\Users\app\Anaconda\lib\site-packages\numpy\linalg\linalg.py", line 1323, in svd
      raise LinAlgError('SVD did not converge')
  numpy.linalg.linalg.LinAlgError: SVD did not converge
  </code></pre>
  
  <p>What could be the reason? I haven't seen this message before:</p>
  
  <pre><code>MKL ERROR: Parameter 4 was incorrect on entry to DLASCL.
  </code></pre>
  
  <p>It appears that the error was caused by this line:</p>
  
  <pre><code> temp_g = sm.WLS(y1, self.X, w).fit() 
  </code></pre>