Package: optimx 2025-4.9

optimx: Expanded Replacement and Extension of the 'optim' Function

Provides a replacement and extension of the optim() function to call to several function minimization codes in R in a single statement. These methods handle smooth, possibly box constrained functions of several or many parameters. Note that function 'optimr()' was prepared to simplify the incorporation of minimization codes going forward. Also implements some utility codes and some extra solvers, including safeguarded Newton methods. Many methods previously separate are now included here. This is the version for CRAN.

Authors:John C Nash [aut, cre], Ravi Varadhan [aut], Hans W Borchers [ctb], Gabor Grothendieck [ctb]

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

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

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

On CRAN:

Conda:

12.44 score 6 stars 90 packages 2.3k scripts 25k downloads 21 mentions 44 exports 3 dependencies

Last updated from:c3b014c2c8. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK164
source / vignettesOK193
linux-release-x86_64OK149
macos-release-arm64OK142
macos-oldrel-arm64OK157
windows-develOK121
windows-releaseOK129
windows-oldrelOK116
wasm-releaseOK128

Exports:axsearchbmchkbmstepcheckallsolverschecksolvercoef<-ctrldefaultdispdefaultfnchkgHgengHgenbgrbackgrcentralgrchkgrfwdgrndgrpracmahesschkhjnkktchkmultistartncgnvmopmopm2optimroptchkoptimroptimr2opmoptimxoptsppd_checkpolyoptproptimrRcgminRcgminbRcgminuRvmminRvmminbRvmminuscalechksnewtmsnewtontntnbc

Dependencies:nloptrnumDerivpracma

Adding pracmanm to optimr() in package optimx
Adding a new solver – pracmanm | Testing the result | Conclusion

Last update: 2024-10-22
Started: 2024-10-22

Explaining Gradient Minimizers in R
Abstract | General Approach | Line Search | Approximate derivatives | Bounds and masks constraints | Checking input information | Steepest descents | Newton-like methods | Variable Metric and quasi-Newton methods | Conjugate Gradient methods | Other ideas for simplifying Newton's method | Acknowledgement | References

Last update: 2024-03-15
Started: 2023-09-05

Intro to optimx
Abstract | Background | ``Optimization'' | Intent of package optimx | Unifying the syntax | More than one method at a time | Developments of the optimx() function | Running multiple methods – opm() | Polyalgorithms – multiple methods in sequence | Multiple sets of starting parameters | Bounds | Function and parameter scaling | Access to solver-specific controls | Derivatives | Legacy optimx() function | Solvers provided with the optimx package | Some other functions in the package | Functions that were formerly in the optextras package | References

Last update: 2024-03-15
Started: 2023-09-05

Rvmmin - an R implementation of the Fletcher(1970) variable metric method with bounds and masks
Rvmmin description, examples and tests

Last update: 2024-03-15
Started: 2023-09-05

SNewton: safeguarded Newton methods for function minimization
Safeguarded Newton algorithms | The basic approach | Motivations | Some algorithm possibilities | Computing the search vector | Bounds and masks constraints | Examples | An assessment

Last update: 2024-03-15
Started: 2023-09-05

Using and extending the optimx package
Abstract | Background | ``Optimization'' | Developments of the optimx() function | How the optimr() function (generally) works | Issues in adding a new method | Running multiple methods | Polyalgorithms – multiple methods in sequence | Multiple sets of starting parameters | Derivatives | Structuring the optimr() function | Functions besides optimr() in the package | Functions that were formerly in the optextras package | Program inefficiencies | Providing controls to different algorithms | Testing the package | References

Last update: 2024-03-15
Started: 2023-09-05

Readme and manuals

Help Manual

Help pageTopics
A replacement and extension of the optim() function, plus various optimization toolsoptimx-package
Perform axial search around a supposed MINIMUM and provide diagnosticsaxsearch
Check bounds and masks for parameter constraints used in nonlinear optimizationbmchk
Compute the maximum step along a search direction.bmstep
Test if requested solver is presentcheckallsolvers checksolver
Summarize opm objectcoef.opm coef.optimx coef<- coef<-.opm coef<-.optimx
set control defaultsctrldefault dispdefault
Run tests, where possible, on user objective functionfnchk
Generate gradient and Hessian for a function at given parameters.gHgen
Generate gradient and Hessian for a function at given parameters.gHgenb
Backward difference numerical gradient approximation.grback
Central difference numerical gradient approximation.grcentral
Run tests, where possible, on user objective function and (optionally) gradient and hessiangrchk
Forward difference numerical gradient approximation.grfwd optsp
A reorganization of the call to numDeriv grad() function.grnd
A reorganization of the call to the pracma grad() function.grpracma
Run tests, where possible, on user objective function and (optionally) gradient and hessianhesschk
Compact R Implementation of Hooke and Jeeves Pattern Search Optimizationhjn
Check Kuhn Karush Tucker conditions for a supposed function minimumkktchk
General-purpose optimization - multiple startsmultistart
An R implementation of a Dai / Yuan nonlinear conjugate gradient algorithm.ncg
Variable metric nonlinear function minimization, driver.nvm
General-purpose optimizationopm
Extract optim() solution for one method of opm() resultopm2optimr
General-purpose optimizationoptchk
General-purpose optimizationoptimr
Add a single optimr() solution to a opm() result setoptimr2opm
General-purpose optimizationas.data.frame.optimx optimx [.optimx
Check Hessian matrix is positive definite by attempting a Cholesky decomposition.pd_check
General-purpose optimization - sequential application of methodspolyopt
Compact display of an 'optimr()' result objectproptimr
An R implementation of a Dai / Yuan nonlinear conjugate gradient algorithm.Rcgmin Rcgminb Rcgminu
Truncated Newton function minimizationRtnmin tn tnbc
Variable metric nonlinear function minimization, driver.Rvmmin Rvmminb Rvmminu
Check the scale of the initial parameters and bounds input to an optimization code used in nonlinear optimizationscalechk
Safeguarded Newton methods for function minimization using R functions.snewtm snewton
Summarize optimx objectsummary.optimx