How to do regression between three inputs (x1, x2 and x3) and one outputs (y) using Curve Fitting?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How to do regression between three inputs (x1, x2 and x3) and one outputs (y) using Curve Fitting? The Cuve fittinng show only regression between x1, x2 inputs and z outputs
0 comentarios
Respuestas (2)
Star Strider
el 8 de Jun. de 2015
I don’t have the Curve Fitting Toolbox (Statistics and Optimization instead), so I can’t address the Curve Fitting Toolbox specifically. However it is straightforward to do this with the other functions, by combining the three vectors into one matrix, then addressing them appropriately in your objective function:
x123 = [x1(:), x2(:), x3(:)];
y = [column vector with the same row size as ‘x123’];
f = @(b,x) b(1).*x123(:,1).^b(2) + b(3).*x123(:,2) + x123(:,3); % Example Objective Function
B0 = [choose vector of initial parameter estimates];
B = nlinfit(x123,y,f,B0); % Estimate Parameters
You will have to experiment with the Curve Fitting Toolbox, but since it can use custom objective functions, something like this should work.
0 comentarios
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!