How to do regression between three inputs (x1, x2 and x3) and one outputs (y) using Curve Fitting?

7 次查看(过去 30 天)
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

回答(2 个)

Star Strider
Star Strider 2015-6-8
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.

Radek
Radek 2015-6-9
Many thanks

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by