title: Numpy Polynomial Regression, error arising at higher powers
body: <p>I have the following code for finding the coefficients for polynomial regression,   </p>
  
  <pre><code>x =[-1,0,1,2,3,5,7,9,4,6,8,2,4,6,8,5,2]
  y = [-1,3,2.5,5,4,2,5,4,4,7,3,2,7,9,6,2,6]
  degree = 4
  x = np.asarray(x)
  x = np.vstack((np.ones(len(x)),x))
  i = 2
  for p in range(degree-1):
      xs= np.power(x,i)
      x = np.vstack((x,xs))
      i +=1
  y = np.asarray(y)
  y= np.matrix(y).T
  x= np.matrix(x).T
  parameters =(x.T*x).I*x.T*y
  </code></pre>
  
  <p>this code will work for lower powers but begins to return different results as <strong><code>numpy.polyfit( x, y, degree )</code></strong> at around 16th degree.</p>
  
  <p>Is my code incorrect, why does its result differ at higher powers to the built in function.</p>