Hello,
I am very grateful for the fitting code and have been using it for all my ellipsometry fittings.
However, recently I have implemented a B-Spline fitting to the system and have run into problems. I have a 45 knot b-spline function model that I use to predict ellipsometry data: Psi and Delta.
I call my residual like so:
def residual(params):
model = ellipsFunc(params) #< -- params is the knots that I sent for ellipsometry data
diff = (model[0] - data[0])**2
diff += (model[1] - data[1])**2
diff = diff/(2*len(w_data)-45)
I am trying to fit a section of data that I haven't been able to before with other models, so I hoped the b-spline would offer flexibility.
No matter how many times I run the code, the residual value isn't improving.
This is the call I make:
minimizer_results = minimize(residual,params, gtol=1e-5, xtol=1e-5, ftol = 1.e-5)
I reduced the tolerance values since that came up in a warning message.
Could there be an issue with using b-splines? Or perhaps there is another setting I could consider?
This section of data is very complex, so I did anticipate some difficulty, but to not see any improvement what so ever is worrisome.
Thank you,
Priscilla