SciPy

scipy.interpolate.UnivariateSpline.get_residual

UnivariateSpline.get_residual()[source]

Return weighted sum of squared residuals of the spline approximation: sum((w[i] * (y[i]-spl(x[i])))**2, axis=0).