フィルターのクリア

Multiple regression by hand

3 ビュー (過去 30 日間)
Tahariet Sharon
Tahariet Sharon 2014 年 12 月 2 日
コメント済み: Rena Berman 2018 年 4 月 9 日
Hi,
I want to compute the b of regression using matrix notation: Meaning this:
b1=regress(a,B) % Matlab function regress
into this
b2=((B'*B).^(-1))*B'*a % matrix notation
But I don't get the same betas: b1 is not equal to b2 when B has more than one column. But both are equal when it is simple regression. Not sure what I may be doing wrong,
Thank you, GM
  1 件のコメント
Rena Berman
Rena Berman 2018 年 4 月 9 日
(Answers Dev) Restored edit

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2014 年 12 月 2 日
What is your B?
I think the formula should be
b2 = inv(B'*B) * B' * a;
  4 件のコメント
Tahariet Sharon
Tahariet Sharon 2014 年 12 月 3 日
Thanks, thanks, thanks, thanks!
Image Analyst
Image Analyst 2014 年 12 月 4 日
編集済み: Image Analyst 2014 年 12 月 4 日
John's correct that the more MATLAB-ish backslash method is preferable to the standard "book" formula like I gave, and which is what I thought you wanted. I think I can give myself a pat on the back though for raising John to a level of excitement rarely, if ever, seen before. :-) Now I have a challenge to see what it will take to get 30 NO's.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by