title: Most accurate way to interpolate data and find the peak?
body: <p>The data I have is always on a second degree polynomial (quadratic function). I want to find the peak of the interpolated function as accurately as possible.</p>
  
  <p><img src="https://i.stack.imgur.com/eEt1z.png" alt="Data sample points"></p>
  
  <p>So far I've been using <code>interp1d</code> and then extract the peak value using <code>linspace</code> and a simple <code>for</code> loop. Although you can use a large number of newly generated samples in <code>linspace</code> you can still be more precise using the derivative of the fitted polynomial.<br> I haven't found a way to do that using <code>interp1d</code>.</p>
  
  <p>Now the only function I've found that returns the fitted polynomial coefficients is <code>polyfit</code>, but this fitted function is quite inaccurate (most of the time the function doesn't even go through the data points).</p>
  
  <p><img src="https://i.stack.imgur.com/8L5kk.png" alt="&lt;code&gt;interp1d&lt;/code&gt; and &lt;code&gt;polyfit&lt;/code&gt; functions"></p>
  
  <p>I've tried using <code>UnivariateSpline</code> and the fitted function seems to be quite accurate and it's very simple to get the derivative spline and its root. </p>
  
  <p>Other polynomial fitting functions (<code>BarycentricInterpolator</code>, <code>KroghInterpolator</code>, ...) state that they are not computing polynomial coefficients for reasons of numerical stability.</p>
  
  <p>How accurate is <code>UnivariateSpline</code> and its derivatives, or are there any better options out there?</p>