MATLAB: I want to find the coefficients for the regression equation using nonlinear regression analysis.

nonlinear regressionregression equation

We want to find the coefficients for the regression equation using nonlinear regression analysis.
For example
M=3, 3, 3, 3, 4, 4, 4, 4
R=0, 10, 20, 30, 0, 10, 20, 30
The corresponding (M,R)=SA and the SA value is not calculated, but I enter it.
SA=5, 10, 20, 16, 15, 10, 30, 13
In other words
(3,0)=5
(3,10)=10
(3,20)=20
(3,30)=16
(4,0)=15
(4,10)=10
(4,20)=30
(4,30)=13
Using this data, I want to find the coefficients a, b, c, and d that satisfy the regression equation SA=a*M+b*log(R+c)+d. How to try…

Best Answer

fminspleas from the file exchange
would be particularly appropriate,
M=[3, 3, 3, 3, 4, 4, 4, 4].';
R=[0, 10, 20, 30, 0, 10, 20, 30].';
SA=[5, 10, 20, 16, 15, 10, 30, 13].';
MR=[M,R];
funlist={ @(c,mr) mr(:,1) , @(c,mr)log(mr(:,2)+c), 1 };
[c,abd]=fminspleas(funlist,0,MR,SA,0);
[a,b,c,d]=deal(abd(1),abd(2), c, abd(3))
a =
4.2500
b =
5.6953
c =
7.4083
d =
-16.7902