title: numpy.polyfit gives useful fit, but infinite covariance matrix
body: <p>I am trying to fit a polynomial to a set of data. Sometimes it may happen that the covariance matrix returned by <code>numpy.ployfit</code> only consists of <code>inf</code>, although the fit seems to be useful. There are no <code>numpy.inf</code> or 'numpy.nan' in the data!</p>
  
  <p>Example:</p>
  
  <pre><code>import numpy as np
  # sample data, does not contain really x**2-like behaviour, 
  # but that should be visible in the fit results
  x = [-449., -454., -459., -464., -469.]
  y = [ 0.9677024,   0.97341953,  0.97724978,  0.98215678,  0.9876293]
  
  fit, cov = np.polyfit(x, y, 2, cov=True)
  
  print 'fit: ', fit
  print 'cov: ', cov
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>fit: [  1.67867158e-06   5.69199547e-04   8.85146009e-01]
  cov: [[ inf  inf  inf]
        [ inf  inf  inf]
        [ inf  inf  inf]]
  </code></pre>
  
  <p><code>np.cov(x,y)</code> gives</p>
  
  <pre><code>[[  6.25000000e+01  -6.07388099e-02]
   [ -6.07388099e-02   5.92268942e-05]]
  </code></pre>
  
  <p>So <code>np.cov</code> is not the same as the covariance returned from <code>np.polyfit</code>. Has anybody an idea what's going on?</p>
  
  <p>EDIT:
  I now got the point that <code>numpy.cov</code> is not what I want. I need the variances of the polynom coefficients, but I dont get them if <code>(len(x) - order - 2.0) == 0</code>. Is there another way to get the variances of the fit polynom coefficients?</p>