I need to solve (many times, for a lot of data, along with a bunch of other things), which, in my opinion, comes down to a second-order cone program . It can be summarized in CVX like this:
cvx_begin variable X(2000); expression MX(2000); MX = M * X; minimize( norm(A * X - b) + gamma * norm(MX, 1) ) subject to X >= 0 MX((1:500) * 4 - 3) == MX((1:500) * 4 - 2) MX((1:500) * 4 - 1) == MX((1:500) * 4) cvx_end
The shown data lengths and equality constraint patterns are simply arbitrary values ββfrom some test data, but the general form will be almost the same as the two objective terms - one minimizing error, the other encouraging sparseness - and a large number of equality constraints on the elements of the converted version of the optimization variable (which in itself is non-negative).
This seems to work very well, much better than my previous approach, which pushes restrictions to something rotten. The trouble is that everything else around this happens in R, and it would be pretty annoying to port it to Matlab. So makes it viable in R, and if so, how?
It really comes down to two separate issues:
1) Are there any good R resources for this? As far as I can tell from the CRAN task page , the options for the SOCP CLSCOP and DWD package, which includes the SOCP solver as an addition to its classifier. Both have similar, but rather opaque interfaces and a little thin on the documentation and examples, which leads us to:
2) What is the best way to present the above problem in the format of the restriction block used by these packages? The CVX syntax above hides a lot of tedious errors with extra variables, etc., and I can just see how I spend weeks trying to get it right, so any tips or pointers to push me in the right direction would be very welcome. ..