How to do Multivariate Regression Analysis in Matlab
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sebastian Daneli
el 10 de Nov. de 2021
Respondida: Sahil Jain
el 16 de Nov. de 2021
Let's say that I have the model
and the data
X=[1 1 1 1 1; 0 1 2 3 4]';
Y=[1 4 3 8 9; -1 -1 2 3 2]';
How can I fit and evaluate this multivariate data in Matlab?
1 comentario
Sargondjani
el 10 de Nov. de 2021
X(:,1) consists of constants, so I assme you want to regress:
a1 = regress(Y(:,1),X);
a2 = regress(Y(:,2),X);
If you really want to regress Y(:,1) on X(:,1) you will only estimate the mean (since X(:,1) consists of ones). Note that B(0,1) and B(1,1) are collinear, in that case.
Respuesta aceptada
Sahil Jain
el 16 de Nov. de 2021
X=[1 1 1 1 1; 0 1 2 3 4]';
Y=[1 4 3 8 9; -1 -1 2 3 2]';
beta = mvregress(X,Y)
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!