World Library  
Flag as Inappropriate
Email this Article

Non-negative least squares

Article Id: WHEBN0041740999
Reproduction Date:

Title: Non-negative least squares  
Author: World Heritage Encyclopedia
Language: English
Subject: Linear least squares (mathematics), Generalized least squares, General linear model, Fixed effects model, Errors-in-variables models
Publisher: World Heritage Encyclopedia

Non-negative least squares

In mathematical optimization, the problem of non-negative least squares (NNLS) is a constrained version of the least squares problem where the coefficients are not allowed to become negative. That is, given a matrix A and a (column) vector of response variables y, the goal is to find[1]

\operatorname*{arg\,min}_\mathbf{x} \|\mathbf{Ax} - \mathbf{y}\|_2 subject to x ≥ 0.

Here, x ≥ 0 means that each component of the vector x should be non-negative and ‖·‖₂ denotes the Euclidean norm.

Non-negative least squares problems turn up as subproblems in matrix decomposition, e.g. in algorithms for PARAFAC[2] and non-negative matrix/tensor factorization.[3][4] The latter can be considered a generalization of NNLS.[1]

Another generalization of NNLS is bounded-variable least squares (BLVS), with simultaneous upper and lower bounds αx ≤ β.[5]:291[6]

Quadratic programming version

The NNLS problem is equivalent to a quadratic programming problem

\operatorname*{arg\,min}_\mathbf{x \ge 0} \frac{1}{2} \mathbf{x}^\mathsf{T} \mathbf{Q}\mathbf{x} + \mathbf{c}^\mathsf{T} \mathbf{x},

where Q = AA and c = Ay. This problem is convex as Q is positive semidefinite and the non-negativity constraints form a convex feasible set.[7]


The first widely used algorithm for solving this problem is an active set method published by Lawson and Hanson in their 1974 book Solving Least Squares Problems.[5]:291 In pseudocode, this algorithm looks as follows:[1][2]

  • Inputs:
    • a real-valued matrix A of dimension m × n
    • a real-valued vector y of dimension m
    • a real value t, the tolerance for the stopping criterion
  • Initialize:
    • Set P = ∅
    • Set R = {1, ..., n}
    • Set x to an all-zero vector of dimension n
    • Set w = Aᵀ(yAx)
  • Main loop: while R ≠ ∅ and max(w) > t,
    • Let j be the index of max(w) in w
    • Add j to P
    • Remove j from R
    • Let AP be A restricted to the variables included in P
    • Let SP = ((AP)ᵀ AP)-1 (AP)ᵀy
    • While min(SP ≤ 0):
      • Let α = min(xi/xi - si) for i in P where si ≤ 0
      • Set x to x + α(s - x)
      • Move to R all indices j in P such that xj = 0
      • Set sP = ((AP)ᵀ AP)-1 (AP)ᵀy
      • Set sR to zero
      • Set x to s
      • Set w to Aᵀ(yAx)

This algorithm takes a finite number of steps to reach a solution and smoothly improves its candidate solution as it goes (so it can find good approximate solutions when cut off at a reasonable number of iterations), but is very slow in practice, owing largely to the computation of the pseudoinverse ((Aᴾ)ᵀ Aᴾ)⁻¹.[1] Variants of this algorithm are available in Matlab as the routine lsqnonneg[1] and in SciPy as optimize.nnls.[8]

Many improved algorithms have been suggested since 1974.[1] Fast NNLS (FNNLS) is an optimized version of the Lawson—Hanson algorithm.[2] Other algorithms include variants of Landweber's gradient descent method[9] and coordinate-wise optimization based on the quadratic programming problem above.[7]

See also


  1. ^ a b c d e f
  2. ^ a b c
  3. ^
  4. ^
  5. ^ a b
  6. ^
  7. ^ a b
  8. ^
  9. ^
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.