Out of memory problem

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)

José-Luis
José-Luis on 20 Sep 2012
Edited: José-Luis on 20 Sep 2012
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

Asked:

on 20 Sep 2012

Community Treasure Hunt

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

Start Hunting!