I am having trouble implementing the most basic NLLS algorithm. I am following the example from here to every detail, yet my implementation keeps on diverging after 5 or so iterations. I will give an outline of what I'm doing below.
The example tries to fit the data to a Gaussian function, so the paramters for my model are .
Make an initial guess of the paramters
Compute the values of the Jacobian using the current paramter values for each data point
Compute the value of the current model approximation
Error between the data set and the current model
If the error is large, update the paramter values as follows
Loop back to Step 2.
If my pseudo-code has confused things, please ignore it and just describe how such a basic NLLS algorithm should be implemented.