Skip to content

Impact of the finite difference Jacobian matrix calculus

GSL non-linear minimization solver has quite some options to finely customize its main algorithm including various model-specific enhancements, extensible numerical algorithms, etc.

Among them, the so-called Jacobian matrix calculus is one of the most important. By defining a model, user code can supply also a callback to calculate d f (x_i) / d p_i which is then used by minimization algorithm to define change for the parameter p_i for the next iteration. If user code does not provide this callback, a set of points will be calculated in the vicinity of p_i within some small step (2 GSL eps) to get the finite difference approximation for the same quantity.

Refer to this part of GSL documentation for algorithm details (note the different nomenclature: x on the page corresponds to parameters being minimized and y is the data points), this example for a primer.

It turned out, however, that for our waveform fitting this thing has significant impact in terms, performance and stability and eventually results (!). For instance, these two samples of Moyal fitting are different in only the Jscobian matrix. This one was evaluated with analytic derivatives:

image

and this one with the numeric approximation:

image

The merging was applied in one case, while in another converged peaks have evaded time window.