I would like to fit
data with a function f(x), where f(x) = (K)(xlog(x) + (1-x)log(1-x)) + Ax*(1-x) + B*(x)*2(1-x)**2, and K, A, B are the fitted constants. And,
is what I have until now, where green solid line is the fitted curve. Here is the Data and below my gnuplot script
f(x)= (K)*(x*log(x) + (1-x)*log(1-x)) + A*x*(1-x) + B*(x)**2*(1-x)**2
pl '1417.dat' u 1:2
fit f(x) '1417.dat' u 1:2 via K,A,B
Obtained K = 8116.63, A = 2.20, B=43692
I need to fit accurately at the minima regions, can anyone suggest how to fit with less deviation.


xby1-xeverywhere => your function will not change. In contrast, the data is not symmetric. So basically the fit function will not match the data. You should check the physical background of your data. Maybe a linear term (+C+D*x) might help?