title: Confidence interval for exponential curve fit
body: <p>I'm trying to obtain a confidence interval on an exponential fit to some <code>x,y</code> data (available <a href="http://pastebin.com/TDFLgtvi" rel="noreferrer">here</a>). Here's the MWE I have to find the best exponential fit to the data:</p>
  
  <pre><code>from pylab import *
  from scipy.optimize import curve_fit
  
  # Read data.
  x, y = np.loadtxt('exponential_data.dat', unpack=True)
  
  def func(x, a, b, c):
      '''Exponential 3-param function.'''
      return a * np.exp(b * x) + c
  
  # Find best fit.
  popt, pcov = curve_fit(func, x, y)
  print popt
  
  # Plot data and best fit curve.
  scatter(x, y)
  x = linspace(11, 23, 100)
  plot(x, func(x, *popt), c='r')
  show()
  </code></pre>
  
  <p>which produces:</p>
  
  <p><img src="https://i.stack.imgur.com/7DQSt.png" alt="enter image description here"></p>
  
  <p>How can I obtain the 95% (or some other value) confidence interval on this fit preferably using either pure <code>python</code>, <code>numpy</code> or <code>scipy</code> (which are the packages I already have installed)?</p>