MATLAB: Sparse matrix in OLS , sparse matrix transpose and multiply

olssparse matrixtranspose and multiply of sparse matrix

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?

Best Answer

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