Sparse matrix in OLS , sparse matrix transpose and multiply

I need to estimate B in this equation that u = error Y = B * X + u
the estimator of B = (inv (X '* X)) * (X' * Y)
X and Y are sparse matrix, how can I do it?
I use sparseinv instead of inv but I dint know how transpose it and maltiple them, Is there any one to know it?

 採用された回答

Star Strider
Star Strider 2018 年 12 月 11 日

0 投票

See if the lsqr (link) function will do what you want.

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 12 月 9 日

1 投票

B = Y/X

2 件のコメント

Nooshin Mahmoodi
Nooshin Mahmoodi 2018 年 12 月 11 日
I can not use this because the matrix dimensions are not the same,
y is 15722*1 sparse double
and
X is 15772 *6 sparse double
Bruno Luong
Bruno Luong 2018 年 12 月 11 日
編集済み: Bruno Luong 2018 年 12 月 11 日
B*X
must have 6 columns, and there is not B that can makes it becomes 1 column.
Unless if you ask to solve B for y = X*B then in this case
B = X\Y
Matrix multiplication must be expressed with correct order.

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

カテゴリ

ヘルプ センター および File ExchangeSparse Matrices についてさらに検索

質問済み:

2018 年 12 月 9 日

編集済み:

2018 年 12 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by