Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to find the multiple linear regression coefficients for this case?

1 回表示 (過去 30 日間)
Abhishek Chakraborty
Abhishek Chakraborty 2021 年 10 月 30 日
閉鎖済み: John D'Errico 2021 年 10 月 30 日
I have three matrices each of 3420 rows and 28 columns, namely, y, x1, and x2. I want to build a multiple linear regression such that:
I wanted to know the multiple linear regression coefficients and each of them will be arrays of 3420 rows and 1 column. How to do it?
I tried the following code:
y=rand([3420,28]);
x1=rand([3420,28]);
x2=rand([3420,28]);
n = 3420;
b = zeros(n,4);
X=zeros(n,4);
for i=1:n
X(i,4)=[ones([28,1]) x1(i,:)' x2(i,:)' (x1(i,:).*x2(i,:))'];
b(i,4)=(regress(y(i,:)',X(i,4)))';
end
Kindly help me with the same.
  1 件のコメント
Ive J
Ive J 2021 年 10 月 30 日
You've already asked this question. Check your answer there.

回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by