I have a custom model which I want to fit to my data. The model works manually, i.e. when I know approximately the fit paramaters. But now I need to optimize this solution, so that it works for similar curves (the one that I will give here is only a perfect noise free data), so please consider this problem in a general case.
The fit model is:
function [x,errorfitted] = fit1d_ABCpara(q,psd1d)x0 = [2e-10,6e-4, 2.4];lb = [1e-11, 3e-04,2];ub = [Inf,3e-3,3];fun = @(x,xdata)0.5e14 * x(1) .* (1+((x(2).*q).^2)).^-((x(3)/2));[x,errorfitted] = lsqcurvefit(fun,x0,q,psd1d,lb,ub);
This is the curve for original data points:
This is the fit I get from the code above for my data in log-log space:
But this is what I want and I could get the fit by manually changing my fit parameters:
How can I optimize my 3 parameters?
Thanks in advance!
Best Answer