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

5 vues (au cours des 30 derniers jours)
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

Réponses (2)

Star Strider
Star Strider le 8 Juin 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.

Radek
Radek le 9 Juin 2015
Many thanks

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by