"mvregress" does not do Multivariate Linear Regression?
조회 수: 1 (최근 30일)
이전 댓글 표시
The documentation for function "mvregress" states that the return value "beta" is a vector of the regression coefficients. Looking deeper into "Multivariate Normal Regression", we see that matlab uses the same regression coefficients ("beta") for every dimension of the multivariate response variable Y
This is ludicrous. Of course each component of the response variable can have its own set of coefficients. THAT is multivariate linear regression.
Am I missing something? Is this just an inherent shortcoming in matlab's "mvregress" function? If so, what a bizarre design choice...
Is there some way to get real multivariate linear regression, i.e. get a matrix beta of regression coefficients?
댓글 수: 2
Ricardo Arévalo
2016년 10월 18일
If you use regress, remember to add a column of ones to indicate that there is a constant in your regression model.
I leave an example:
%Let lon, lat and alt be the independant variables of a model.
lon=[61;63;64;68;71;73;75];
lat=[139;140;129;128;140;141;128];
alt=[325;300;400;250;210;160;175];
%Let pre be the dependant variable of the model.
pre=[477;696;227;646;606;791;789];
%Adding a column of ones to get the constant.
predictors=[ones(size(lon)),lon,lat,alt];
%This will create a regression model of type:
% Pre=a0+(a1*lon)+(a2*lat)+(a3*alt), it also gives stats and residuals
[b,bint,r,rint,stats] = regress(pre,predictors);
채택된 답변
the cyclist
2013년 3월 16일
편집: the cyclist
2013년 3월 16일
You are missing something. See my answer in this thread for several examples of using design matrices with mvregress():
댓글 수: 3
Anoosh
2016년 1월 23일
편집: Anoosh
2016년 1월 23일
@thecyclist I am trying to use mvregress with the data I have with dimensionality of a couple of hundreds. (3~4). Using 32 gb of ram, I can not compute beta and I get "out of memory" message. I couldn't find any limitation of use for mvregress that prevents me to apply it on vectors with this degree of dimensionality, am I doing something wrong? is there any way to use multivar linear regression via my data?
the cyclist
2016년 1월 23일
@Anoosh:
Although this is a perfectly sensible place to ask this question, you won't actually get much attention from a comment buried in a 3-year-old thread.
I suggest you ask a new question. If you can actually attach files with your data and code, that will help people diagnose your issue.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!