Initial values in multivariate nonlinear regression
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!