Non Linear Least Squares with Inequality Constraints
Overview
We solve non linear least squares problems with optional equality and/or inequality constraints. Non linear iterations are globalized with back-tracking method. Linear problems are solved by dense QR decomposition from 'LAPACK' which can limit the size of treated problems. On the other side, we avoid condition number degradation which happens in classical quadratic programming approach. Inequality constraints treatment on each non linear iteration is based on 'NNLS' method (by Lawson and Hanson). We provide an original function 'lsi_ln' for solving linear least squares problem with inequality constraints in least norm sens. Thus if Jacobian of the problem is rank deficient a solution still can be provided. However, truncation errors are probable in this case. Equality constraints are treated by using a basis of Null-space. User defined function calculating residuals must return a list having residual vector (not their squared sum) and Jacobian. If Jacobian is not in the returned list, package 'numDeriv' is used to calculated finite difference version of Jacobian. The 'NLSIC' method was fist published in Sokol et al. (2012) doi:10.1093/bioinformatics/btr716.
- nlsic(): added reuse of jacobian in non linear iterations
- con$reuse_jac=TRUE (do it by default)
- con$max_reuse=5L (default maximal number of jacobian reuses)
- nlsic(): con$btfrac default value is brought to 0.8 instead of 0.5.
- lsi() and lsi_ln() return x with
aqrattribute containing QR decomposition of matrix a. This is used to spare some calculations in non linear iterations
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 16
- Examples that run
- 100%5 run in a plain check
- Exported functions with examples
- 33%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Issues over time
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/mathscell/nlsic on 2026-10-22.
Dependencies
Installing nlsic adds 3 packages (2 with compiled code, 143 KB of source tarballs). Heaviest: glue 127 KB, nnls 11 KB, dotty 4.5 KB.
Code & Tests
People & History
Package metadata
- First published
- 2022-01-11
- Total releases
- 6 / 4 yrs
- License
- GPL-2 OSI
- Download size
- 25 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("nlsic")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.