Out of memory problem
Show older comments
Dear all,
I am trying to compute a constrained OLS estimator, but I have issues related to the size of the matrix that I am using. My code is the following:
vecX=vec(X_st); kronF = kron(eye(N),FY); L_OLS = inv(FY'*FY)*(FY'*X_st(:,:)); vecL_OLS = vec(L_OLS); vecL_COLS = vecL_OLS - inv(kronF'*kronF)*Rest'*inv(Rest*inv(kronF'*kronF)*Rest')*(Rest*vecL_OLS - Const);
I have trouble with the computation of the kronoecker product "kron(eye(N),FY)" especially, where N = 400 and FY is 57 per 5 which makes my resulting matrix kronF too big to be undle under my system.
System: Windows XP 2002 Intel Xeon CPU 2,67Ghz 3 GB RAM Matlab 2007b, v7.5.0
Could any one suggest me a solution relatively fast to implement. Thanks
Answers (1)
You have several options:
Use sparse matrices :
a = sparse(eye(400));
your_mat = sparse(kron(a,rand(57,5));
The not so good solution:
Increase your swap space. I don't remember how to do that in Windows (where it's called virtual memory), but google is your friend. That might make your code very slow.
What you probably don't want to hear:
Get more RAM, although that won't help much if you are in a 32 bit system.
Categories
Find more on Excel Add-Ins in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!