Package: nlsr 2025.02.16

nlsr: Functions for Nonlinear Least Squares Solutions - Updated 2022

Provides tools for working with nonlinear least squares problems. For the estimation of models reliable and robust tools than nls(), where the the Gauss-Newton method frequently stops with 'singular gradient' messages. This is accomplished by using, where possible, analytic derivatives to compute the matrix of derivatives and a stabilization of the solution of the estimation equations. Tools for approximate or externally supplied derivative matrices are included. Bounds and masks on parameters are handled properly.

Authors:John C Nash [aut, cre], Duncan Murdoch [aut], Fernando Miguez [ctb], Arkajyoti Bhattacharjee [ctb]

nlsr_2025.02.16.tar.gz
nlsr_2025.02.16.zip(r-4.7)nlsr_2025.02.16.zip(r-4.6)nlsr_2025.02.16.zip(r-4.5)
nlsr_2025.02.16.tgz(r-4.6-any)nlsr_2025.02.16.tgz(r-4.5-any)
nlsr_2025.02.16.tar.gz(r-4.7-any)nlsr_2025.02.16.tar.gz(r-4.6-any)
nlsr_2025.02.16.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
nlsr/json (API)

# Install 'nlsr' in R:
install.packages('nlsr', repos = c('https://nashjc.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/nashjc/nlsr/issues

On CRAN:

Conda:

6.60 score 1 stars 4 packages 133 scripts 889 downloads 1 mentions 39 exports 1 dependencies

Last updated from:7e4c212ee7. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING130
source / vignettesOK211
linux-release-x86_64WARNING125
macos-release-arm64WARNING87
macos-oldrel-arm64WARNING76
windows-develWARNING88
windows-releaseWARNING72
windows-oldrelWARNING102
wasm-releaseOK100

Exports:codeDerivdexfindSubexprsfnDerivisCALLisMINUSONEisONEisZEROjabackjacentraljafwdjandmodel2rjfunmodel2ssgrfunmodelexprnewDerivnewSimplificationnlfbnlsDerivnlsrnlsr.controlnlsrSSnlsSimplifynlxbnumericDerivRnvecpctrlpnlspnlslmprtpshortrawresresgrresssSSlogisJNSSmod2rjfunsysDerivssysSimplificationswrapnlsr

Dependencies:digest

An introduction to nlsr
What does nlsr do? | Output object | Jacobian calculation | Stabilization of Gauss-Newton computations | Programming language | An illustrative example | Problem setup | Solution attempts with nls() | Solution attempts with nlsr tools | Solution attempts with minpack.lm | Solution attempts with wrapnlsr() wrapper | Commentary | Extracting standard errors from nlsr solutions | selfStart options | SSlogisJN.R for the 3-parameter logistic | Running selfStart models with nlxb() | Starting parameters for the Logistic3U model | Jacobian computation | Bounds constraints on parameters | Functional specification of nonlinear least squares problems | Weighted nonlinear regression | Static weights | Weights that are functions of the model parameters | Models that use multiple functional forms | Two straight lines | The WOOD test function | Ongoing efforts | References

Last update: 2024-04-06
Started: 2023-09-03

nlsr/nlsr Background, Development, and Discussion
Overview and objectives | 0. Issues remaining to address and TODOS | nls() uses different models with different algorithm choices | MINOR -- Bounds specification and warnings for nlsLM and nls.lm | MINOR -- nlsLM and nls.lm do not warn of out of bounds initial parameters | Bounded minimization with minpack.lm | TODOS | 1. Summary of capabilities and functions in nlsr | nlxb | model2rjfun, model2ssgrfun, modelexpr | nlfb -- minimize nonlinear least squares residual functions | coef.nlsr | print.nlsr | summary.nlsr | wrapnlsr | resgr, resss | nlsDeriv, codeDeriv, fnDeriv, newDeriv | nlsSimplify and related functions | 2. Analytic versus approximate Jacobians | Specifying approximations to nlfb | Specifying Jacobian approximations to nlxb | 3. Weighted nonlinear regression | Static weights | Dynamic weights via the wfct() function | Weights built into a one-sided model function | 4. Relative offset and other convergence criteria | Overview of the ROCC test | Some implementation ideas for the ROCC | Other convergence and termination tests | 5. Implementation of nonlinear least squares methods | Gauss-Newton variants | Choices | Using matrix decompositions | 6. Fixed parameters | Motivation for fixed parameters | Background for fixed parameters | Internal structures to specify fixed parameters | Proposed approaches to fix parameters | Examples of use of fixed parameters | 7. Capabilities added to nlsr in the 2022 version | Numerical approximations to Jacobians | Self start models | Models with partially linear parameters | 8. Capabilities still missing from nlsr | Automatic differentiation of functional models | Indexed parameters | 9. Nonlinear equations and other non-modelling problems | Appendix A: Providing exogenous data | Appendix B: Derivative approximation in nls() | From nls.R | From nls.c | nlsr::numericDerivR.R | Appendix C: A comparison of nlsr::nlxb with nls and minpack::nlsLM | Principal differences | Derivative information | Consequences of different derivative computations | Timing comparisons | Programmatic modelling functions | Functional expression of residuals and Jacobian | Marquardt stabilization | Criterion used to terminate the iteration | Output of the modelling functions | Prediction | An illustrative nonlinear regression problem | nls | nlsr | minpack.lm | Problems that are NOT regressions | A check on the Brown and Dennis calculation via function minimization | References

Last update: 2024-04-06
Started: 2023-09-03

nlsr and Other Approaches to Derivatives in R
Available analytic differentiation tools | How the tools are used | stats (i.e., the base R installation) | nlsr | Deriv | Ryacas | Derivatives and simplifications -- base R | Derivatives and simplifications -- package nlsr | Derivatives table | Notes: | Simplifying algebraic expressions | Derivatives and simplifications -- package Deriv | Simplifications | Comparison with other approaches | check modelexpr() works with an ssgrfun ?? | test model2rjfun vs model2rjfunx ?? | Need more extensive discussion of Simplify?? | Issues of programming on the language | Another issue: | Indexed parameters or variables | References

Last update: 2024-04-06
Started: 2023-09-03

Specifying and Using Fixed Parameters in Nonlinear Estimation
Motivation | Background | Internal structures | Proposed algorithmic approaches | Examples of use | For optimx | An extensible bell-curve model | References

Last update: 2024-04-06
Started: 2023-09-03

Symbolic and analytical derivatives in R
Available analytic differentiation tools | How the tools are used | stats (i.e., the base R installation) | nlsr | Deriv | Ryacas | Derivatives and simplifications -- base R | Derivatives and simplifications -- package nlsr | Derivatives table | Notes: | Simplifying algebraic expressions | Derivatives and simplifications -- package Deriv | Simplifications | Comparison with other approaches | check modelexpr() works with an ssgrfun ?? | test model2rjfun vs model2rjfunx ?? | Need more extensive discussion of Simplify?? | Issues of programming on the language | Indexed parameters or variables | Appendix D: A comparison of nlsr::nlxb with nls and minpack::nlsLM | Principal differences | Derivative information | Consequences of different derivative computations | Timing comparisons | Programmatic modelling functions | Functional expression of residuals and Jacobian | Marquardt stabilization | Criterion used to terminate the iteration | Output of the modelling functions | Prediction | An illustrative nonlinear regression problem | nls | minpack.lm | Problems that are NOT regressions | A check on the Brown and Dennis calculation via function minimization | References

Last update: 2024-04-06
Started: 2023-09-03