I am working on a large QP problem, the problem is as follows:
r = sdpvar(len_r, 1); % len_r = 70000
r_mean = ones(len, 1); % this is a user-defined value
cov_mat = correlation(); % this is a computed co-variance matrix and is guaranteed to be positive definite. Its size is 70000*70000
Constraints = [-1 <= r <= r, others] % all constraints are linear
My objective is to minimize (r - r_mean)' * cov_mat^(-1) * (r - r_mean)
The problem was supposed to be set as
Objective = transpose(r - r_mean) * cov_mat^(-1) * (r - r_mean);
options = sdpsettings('verbose',1,'solver','cplex','cplex.qpmethod',1);
sol = solvesdp(Constraints,Objective, options);
if sol.problem == 0
solution = sparse(double(r));
else
display('Hmm, something went wrong!');
yalmiperror(sol.problem);
end
I know it is very difficult to inverse cov_mat and it is not necessary either. So I have tried setting objective as
Objective = transpose(r - r_mean) * (cov_mat\(r - r_mean));
and
Objective = matrix_partition_comp( len_r, cov_mat, r_mean, r );
Unfortunately, I always receive the error message: Error using sdpvar/mtimes Out of memory. Type HELP MEMORY for your options.
It is worth mentioning that if cov_mat is a simple identity matrix then the cplex works. However, cov_mat in my problem cannot be that simple, usually complicated.
I know I have too many variables (r) to solve, but I have to. Can anyone help me with this problem?