MATLAB: Error calculation perfect fit

matlab error fit

Hi guys, so I have experimental data in column matrix y. And I want to use the equation below to find x as a function of y. This means have constant b adjusted from 0 to 2 and hence want to obtain the ideal b value.
I'm thinking of using a double for loop however would anyone know how to calculate for error and set a desirable tolerance. Or tips on how to solve for it effectively?
Thanks in advance. The equation is:
y= (1-0.05*x^(b))/(1-0.03*x^b)^2

Best Answer

I would use nlinfit and nlparci to estimate ‘b’, and use a few values of ‘x’ and ‘y’ to provide an initial estimate, with:
b = log(20*(1-1./y))./log(x);
Noting the assumptions and restrictions that I mentioned earlier.