(Sorry about formatting, I will try my best) I want to solve:
x = argmin_x (Ax - p)'(Ax - p)
s.t. x >= b
where A
is a NxH
logical matrix (roughly half zeros, half ones), b
is a Hx1
constant vector where every entry is the same (e.g., b = (0.1,0.1,0.1,...)
. p
is a constant Nx1
vector of probabilities, so all entries are in [0,1]
. Optimal x
is a distribution as well, so all of its entries should be in [0,1]
. Note that,in practice H
is very large, e.g. 2 million
and N
is relatively small, e.g. 150
.
I am currently using CVX to solve this. Explicitly, my code is:
b= 0.1.*ones(H,1)/H;
cvx_begin quiet
variable x(H)
minimize( norm((A*x-p),2))
subject to
x >= b;
cvx_end
This produces the correct result. However, it is fairly slow when H
is large. Given the structure of my optimization program (logical A, constant constraint, problem that has an analytical solution IF there were no constraint, ect), is there a better way to approach this? Is CVX recommended here?
Thank you for your help.