Curve fitting the second integral of a normal distribution I have a data set of points that I need to fit to a normal distribution, where the points approximate the curve of the distribution's second integral. Examples of such curves are given below in the first image, and an example of the data set is given in the second image.
How would one approach curve fitting here? I was thinking of implementing non-linear regression (Gauss-Newton), but that method assumes that the partial derivatives of the target function are known. Is there any clean way to approximate the residuals and jacobian matrix for this problem? Any existing software libraries, or references of interest?
Thank you



Analytical derivations for applicability to Gauss-Newton are simple after all. I mistakenly thought the derivatives were hard.
For residuals, the cumulative normal distribution function is equal to the Gauss Error function by scaling and translation. The antiderivative is exactly $z\ \text{erf}\ z + \frac{e^{-z^2}}{\sqrt{\pi}}$ and can be derived by integration by parts. Software libraries usually include the normal CDF (and its inverse) as a built-in.
The Jacobian is computable by the chain rule and the fundamental theorem of calculus using again the normal CDF. Set $z = (x - \mu) / \sigma$.
$$\frac{d\Psi(z)}{d\mu} = \frac{d\Psi(z)}{dz} \frac{dz}{d\mu} = - \frac{\Phi(z)}{\sigma}$$
$$\frac{d\Psi(z)}{d\sigma} = \frac{d\Psi(z)}{dz} \frac{dz}{d\sigma} = - \frac{z\ \Phi(z)}{\sigma}$$
Convergence is a non-issue for this class of functions.
