Can I use custom fitting methods for esfit()? Primarily interested in methods from MATLAB's Global Optimisation Toolbox. It seems similar to using the lsqnolin function from a similar Optimisation Toolbox.
This seems to require only minor changes to the esfit()
source code, am I right?
Custom fitting methods for esfit
Custom fitting methods for esfit
-
- EasySpin Creator
- Posts: 1136
- Joined: Mon Jul 21, 2014 10:11 pm
- Location: University of Washington
Re: Custom fitting methods for esfit
This is currently not possible. All the optimization algorithms are hard-wired into esfit
, and most of them are EasySpin implementations.
But there might be a workaround hack: Take your custom optimization function, wrap it with a function called lsqnonlin
, make sure it has the same input syntax as lsqnonlin
from the Optimization Toolbox, and use it with Opt.Method = 'lsqnonlin'
.
Re: Custom fitting methods for esfit
Thanks. I see, esfit()
calls lsqnonlin()
at the form
[pfit_active,~,~,~,output] = lsqnonlin(residualfun,p0_active,lb_active,ub_active);
So, the outpust of the 'fake' lsqnonlin()
should be the same, am I right?