title: Calculating slope and intercept error of linear regression
body: <p>I have a very simple case of 3 Datapoints and I would like to do a linear fit <code>y=a0 + a1x</code> through those points using <code>np.polyfit</code> or <code>scipy.stats.linregress</code>. </p>
  
  <p>For the further error propagation I need the errors in the slope and the intercept. I am by far no expert in statistics but on the scipy side I am only aware of the stderr which does not split in slope and intercept.
  Polyfit has the possibly to estimate the covariance matrix, but this does not work with only 3 datapoints. </p>
  
  <p>When using qtiplot for example it yields errors for slope and intercept.</p>
  
  <pre><code>B (y-intercept) = 9,291335740072202e-12 +/- 2,391260092282606e-13
  A (slope) = 2,527075812274368e-12 +/- 6,878180102259077e-13
  </code></pre>
  
  <p>What would be the appropiate way to calculate these in python?</p>
  
  <p>EDIT:</p>
  
  <pre><code>np.polyfit(x, y, 1, cov=True)
  </code></pre>
  
  <p>results in</p>
  
  <blockquote>
    <p>ValueError: the number of data points must exceed order + 2 for
    Bayesian estimate the covariance matrix</p>
  </blockquote>