Skip to content

Algorithm terminates early when x0 has some coordinates that are zero #51

Description

@jwgarber

I have a biological dataset where the algorithm incorrectly declares convergence after a single iteration when x0 = c(0, 0, 0, 0, 0, 0, 0, 0, 1).

Running mix-SQP algorithm 0.3-54 on 1000000 x 9 matrix
convergence tol. (SQP):     1.0e-08
conv. tol. (active-set):    1.0e-10
zero threshold (solution):  1.0e-08
zero thresh. (search dir.): 1.0e-14
l.s. sufficient decrease:   1.0e-02
step size reduction factor: 7.5e-01
minimum step size:          1.0e-08
max. iter (SQP):            1000
max. iter (active-set):     10
number of EM iterations:    0
Computing SVD of 1000000 x 9 matrix.
Matrix is not low-rank; falling back to full matrix.
iter        objective max(rdual) nnz stepsize max.diff nqp nls
   1 +3.721806325e+00 -5.989e-07   1  ------   ------   --  --
Optimization took 0.07 seconds.
Convergence criteria met---optimal solution found.
V0 V1 V2 V3 V4 V5 V6 V7 V8 
 0  0  0  0  0  0  0  0  1 

Using x0 = rep(1/9, 9) converges to the correct solution.

Running mix-SQP algorithm 0.3-54 on 1000000 x 9 matrix
convergence tol. (SQP):     1.0e-08
conv. tol. (active-set):    1.0e-10
zero threshold (solution):  1.0e-08
zero thresh. (search dir.): 1.0e-14
l.s. sufficient decrease:   1.0e-02
step size reduction factor: 7.5e-01
minimum step size:          1.0e-08
max. iter (SQP):            1000
max. iter (active-set):     10
number of EM iterations:    0
Computing SVD of 1000000 x 9 matrix.
Matrix is not low-rank; falling back to full matrix.
iter        objective max(rdual) nnz stepsize max.diff nqp nls
   1 +3.174361296e+00 +1.803e-01   9  ------   ------   --  --
   2 +3.138708847e+00 +1.778e-01   9 7.50e-01 1.59e-01   5   2
   3 +3.136557982e+00 +2.068e-02   9 1.00e+00 4.18e-02   2   1
   4 +3.136535232e+00 +3.823e-04   9 1.00e+00 3.29e-03   2   1
   5 +3.136535224e+00 +7.005e-08   9 1.00e+00 6.60e-05   2   1
   6 +3.136535224e+00 -3.489e-08   9 7.50e-01 2.26e-08   2   2
Optimization took 0.43 seconds.
Convergence criteria met---optimal solution found.
        V0         V1         V2         V3         V4         V5         V6 
0.06678421 0.03496157 0.12561704 0.03255271 0.12555548 0.02334131 0.20496663 
        V7         V8 
0.31307638 0.07314466

I believe this is because the termination condition in the main loop only checks the gradient at non-zero x_i, which on the first iteration is incorrect for x0 when some values are already zero.

    // Report on the algorithm's progress. Here we compute: the
    // smallest gradient value, or, equivalently, dual residual,
    // corresponding to the nonzero co-ordinates (gmin), which is used
    // as a convergence criterion; and the number of nonzeros in the
    // solution (nnz). Note that only the dual residuals (gmin's)
    // corresponding to the nonzero co-ordinates are relevant.
    gmin(i) = 1 + g(j1).min();

    // Check convergence. Convergence is reached with the maximum dual
    // residual is small. The negative of "gmin" is also the maximum
    // dual residual (denoted as "rdual" on p. 609 of Boyd &
    // Vandenberghe, "Convex Optimization", 2009).
    if (gmin(i) >= -convtolsqp) {
      status = 0;
      i++;
      break;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions