Initial values in multivariate nonlinear regression
3 次查看(过去 30 天)
显示 更早的评论
I need to do a multivariate nonlinear regression.The regression would be quadratic with three variables (x1, x2, x3) and looks like the following:
y = a0 + a1x1 + a2x1^2 + a3x2 + a4x2^2 + a5x3 + a6x3^2 + a7x1x2 + a8x1x3 + a9x2x3 + a10x1x2x3
As shown above, the model has 11 coefficients to be estimated.If I am correct, the code should look as following:
load mydata
tbl = table(x1,x2,x3,y);
modelfun = @(b,x)b(1) + b(2)*x(:,1) + b(3)*x(:,1)^2 + b(4)*x(:,2) + b(5)*x(:,2)^2 + b(6)*x(:,3) + b(7)*x(:,3)^2 +...
b(8)*x(:,1)*x(:,2) + b(9)*x(:,1)*x(:,3) + b(10)*x(:,2)*x(:,3) + b(11)*x(:,1)*x(:,2)*x(:,3)
beta0 = [b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11];
mdl = fitnlm(tbl,modelfun,beta0)
My question is how to find good starting guess initial values for beta0. I do not want to use random initial values for the coefficients since that might not lead to a solution. I searched Matlab questions/answers and found that I could use functions such as patternsearch (link) or ga (link), but this would require having the Global Optimization Toolbox. Unfortunatelly, I do not have this toolbox.
0 个评论
采纳的回答
Torsten
2022-5-25
Your model equation
y = a0 + a1x1 + a2x1^2 + a3x2 + a4x2^2 + a5x3 + a6x3^2 + a7x1x2 + a8x1x3 + a9x2x3 + a10x1x2x3
is linear in the model parameters a0, a1,...,a10.
Thus no good starting values will be necessary. Each optimizer will reach the optimal parameters in one step (independent of the starting values).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!