Students submit the data for an acid–base titration to my app. The abscissa axis corresponds to the volume. Along the ordinate axis are the pH values. The curve I’m looking for must work automatically for any experimental data I receive. The logistic regression model fits to the data points poorly:
It seems I’m looking for a sigmoid function of the form
$$y = \frac{L}{1 + \mathrm e^{k(x - x_0)}},$$
where $k$ is the steepness of the curve, and $x_0$ is the midpoint of the curve.
I guess I need something closer to a spline, but I don’t know how to compute a regression model based on a spline. All I can find are interpolation models.
Also, I would like to be able to compute the derivative of the regression. With a spline interpolation, I don't know how to compute the derivative over $x$ so that it appears as a function of a single variable.