How to coup with matrix dimension?

3 ビュー (過去 30 日間)
Tallha Akram
Tallha Akram 2012 年 9 月 14 日
I have equation e.g a* (b*b') to update Covariance Matrix.
a=(200 * 2) 200 rows and 2 cols
b=(200 * 2)
I need an output of dimension (2 * 2), How to deal with this problem. Is there any mathematical Concept i am Lacking?
Thanks in Advance.

回答 (1 件)

Wayne King
Wayne King 2012 年 9 月 14 日
編集済み: Wayne King 2012 年 9 月 14 日
a = randn(200,2);
c = a'*a;
You can just use cov()
a = randn(200,2);
y = cov(a);
The equivalence can be made exact by scaling the output of a'*a along with zero-meaning the columns.
So compare:
a = randn(200,2);
ac = bsxfun(@minus,a,sum(a,1)/200);
(ac'*ac)/199
with
cov(a)
  2 件のコメント
Tallha Akram
Tallha Akram 2012 年 9 月 14 日
Dear King, b matrix can only be of either dimension (2*2) or (200,200) , as i am taking transpose.
Wayne King
Wayne King 2012 年 9 月 14 日
I'm not sure what you're saying. If you have a 200x2 matrix, the covariance matrix is 2x2

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by