Solver Strategy
Non-negative least-squares optimization can be solved systematically by an active-set algorithm that iteratively identifies which constraints are active. The procedure, known as the Lawson-Hanson algorithm, is the standard reference implementation for solving these constrained linear least-squares problems. It guarantees convergence to the global minimum in a finite number of steps by partitioning the variables into an active set of bound variables and a passive set of free variables.
Mathematical Step
At each iteration, the solver calculates an unconstrained least-squares solution for the variables in the passive set while keeping the active variables at zero. If any variable in the passive set violates the non-negativity constraint, an inner loop is executed to move variables from the passive set back to the active set until all passive variables are strictly positive. This process continues until the Kuhn-Tucker optimality conditions are fully satisfied.
The algorithm maintains a QR factorization of the system matrix to update the least-squares solution efficiently when variables move between the sets. This updates avoid the computational cost of factorizing the matrix from scratch at each step.
Calibration Context
In spectroscopic sensors and analytical instruments, the algorithm is used to resolve overlapping spectra into their constituent components. Since physical concentrations or intensities cannot be negative, the algorithm ensures that the reconstructed spectrum has physically meaningful coefficients. This positivity constraint prevents the reconstruction of negative concentrations that would otherwise arise from measurement noise.
Performance Constraint
The primary limitation of the method is its computational scaling, which becomes unfavorable for very large datasets with thousands of variables. Because the method moves only one variable at a time into the active set, the number of iterations can grow rapidly. For high-throughput applications, more modern parallel or interior-point methods are frequently used instead.