Solve Systems of Nonlinear Equations

Solve a system of nonlinear equations using a Broyden or a Newton method with a choice of global strategies such as line search and trust region. There are options for using a numerical or user supplied Jacobian, for specifying a banded numerical Jacobian and for allowing a singular or ill-conditioned Jacobian.



o changed package documentation .Rd to to use metadata macros


o better comments in Fortran source and some reorganization of code o simplification QR update subroutines o documentation tweaks


o prevent possible intermediate NaN's in cubic linesearch o test for NaN's in x-vector supplied to user function while iterating o documentation tweaks for searchZeros o more accurate error messags for non-finite arguments passed to user jacobian function


o more precise error checking in nleqslv.c (bug)


o register native routines in dll


o allow scalar user supplied derivative for a scalar function. (avoid error message about jacobian not being a matrix) (bug) o documentation tweaks


o display inverse condition of Jacobian in "ill-conditioned" message in the return value of nleqslv o documentation tweaks


o removed item Tcnt from the return value of testnslv. In the case of a banded jacobian the value was incorrect (bug). o corrected faulty error message (bug) o code and documentation tweaks


o documentation tweaks o check length of initial estimates to avoid Lapack error messages (bug) o check number of rows of matrix in searchZeros (bug) o check correctly that user supplied jacobian function is actually a function (bug) o searchZeros now uses try with silent=TRUE o searchZeros returns additional indices providing more information about bad/invalid initial estimates


o strict validity test of control argument o documentation tweaks


o added searchZeros function to search for zeros given a matrix of initial points


o added a column to the testnslv output giving the total number of function evaluations if a numerical jacobian was requested o corrected bug in testnslv when termination code > 6 o added test for completely singular jacobian when allowSingular==TRUE (the Levenberg-Marquardt correction will not work in such a situation) (detected with a system of equations made by Ravi Varadhan) o changed columnheaders of dataframe generated by testnslv (sorry about that) o added a width.cutoff argument to the printing of an object returned by testnslv to restrict the length of the call display o added a check of testnslv in tests


o reintroduced the Levenberg-Marquardt correction for ill-conditioned or singular jacobians. It now works as desired.


o display a marker in the trust region iteration report when a trial step will be taken o better documentation of the iteration reports o added input and output files used for the documentation of the iterations reports in a subdirectory of directory inst o more detailed comments in several source files o spelling


o corrected nasty bug in cubic linesearch. Use Higham procedure to calculate roots of a quadratic accurately. The correct test of the shape of a quadratic is the sign of the coefficient of x^2 and not a test involving the discriminant. Some results may change. o corrected package name typo (reported by Kurt Hornik) o minor changes in documentation


o Dennis-Schnabel hookstep added as global strategy "hook" o testnslv adjusted for new extra global strategy o removed all trailing spaces from files (added in by editor)


o allow strings "cauchy" and "newton" in control$delta argument o documentation for iteration report fixed o better comments trial steps when updating trust region


o clarified documentation for iteration report o removed redundant fortran code o modified nwclsh.f to avoid ftnchek warnings o use Lapack dlacpy to copy upper triangular part of a QR decomposition o modified some fortran code for easier conversion with f2f to fortran 95 o modified nwnleq and brsolv to split rjac into Q and R at higher level (avoids some ftnchek warnings) o update package date in DESCRIPTION


o introduce a function to test and optionally benchmark different methods and global strategies and print results compactly o added a new global strategy: cubic line search o try to safeguard against very large trust region in iteration report o allocate half as much memory for the Jacobian when Newton method is specfied o advice in error message on what to do when initial value of function is not finite o cleanup some code


o corrected tiny rounding error when computing banded jacobian (fdjac2 in src/nwutil.f) o corrected error in documentation of iteration report o cleanup fortran sources to remove many (not all) ftnchek warnings o clarifications in the documentation


o introduced an option to specify that the jacobian is banded o if the initial parameter vector has a names attribute, the parameter vector passed to the function to solve will have these names as attribute o corrected another bug when checking a user supplied jacobian: scaled x-values were being returned o use Rinternals.h instead of Rdefines.h o replace C++ style comments o cleanup/simplification of C code in nleqslv.c and more error checking


o introduced an option to return the final (approximated) jacobian o corrected horrible bug when checking analytical jacobian with scaled x-values (checking incorrectly reported an incorrect jacobian) o strict checking of return value of user supplied Jacobian function. Jacobian must be a numerical matrix of correct dimensions. o if the initial parameter vector has an attribute names the output parameter vector will have these names as attribute o more tests of Newton method o (internal) comments in some fortran to provide clarification o (internal) reorganized fortran for less duplication of code o No longer use qrupdate routines for updating QR. Use heavily modified version of Dennis+Schnabel. Change has no effect on results (at least in all my tests).


o checking validity of a user supplied jacobian is no longer done before the first iteration in order to avoid computing initial jacobian twice. The checks are now done after the return of the user supplied jacobian; this provides more safety. o introduced a tolerance parameter for testing for an ill-conditioned jacobian or broyden approximation. The default tolerance is now equal to 1e-12 and not the machine precison. o added an item to the outputlist of nleqslv giving the number of (outer) iterations used. o better description of the meaning of the number of function evaluations in the return value.


o use QR update routines from opensource library qrupdate. The changes should have no effect on results. o internal change in brsolv: use a different larger workspace for brupdt to accomodate different QR updating routines which need a larger workspace o moved subroutine for query of Lapack dgeqrf of optimal size of work array to lautil.f (where it belongs). Changed name to liqsiz.


o made calculation of jacobian when checking user supplied jacobian identical to how calculation of numerical jacobian is done o non finite values in function values when computing numerical derivatives always result in a fatal error o added link to iteration report in the description of trace=1 o corrected several small irregularities in the documentation


o removed all Fortran internal write statements to avoid R check warnings o improved output of possible errors by check jacobian o added error message for jacobian error in manual o mention Lapack condition estimator in documentation of iteration report


o added a pure Newton or Broyden without global strategy o use useDynLib in NAMESPACE instead of .onLoad


o added NAMESPACE and changed to use .onLoad function o removed gamma from iteration report (doesn't provide useful info; eta is sufficient) o minor internal reorganization of code o improved documentation of the iteration report


o remove unused variables from Fortran code (thanks to Kurt Hornik for pointing this out). o improved comments in nwout.c o avoid use of sprintf for print in E-format since on Windows (at least some) three digits are used by default for the exponent even when two suffice. That messes up layout of detailed iteration report. Use Rprintf.


o remove unused variables in C function nleqslv. o tests now only check if a solution has been found with a specified tolerance and avoid explicit floating point output. o corrected small errors in manual.


o nicer output when control argument contains invalid names. o some examples are now not run by default to avoid problems (bus error) on PowerPC Mac OS X; I cannot test.


o Added code to copy initial values to final values in case of bad jacobian.


o cleanup checking of control argument. o modified tests/brdban.R and tests/chquad.R to be more robust against small rounding differences.


o internally scaled x-values are now used instead of scaling/unscaling of various vectors whenever/wherever required. This makes the code much cleaner and easier to maintain. Therefore the jacobian matrix used in the code is now scaled. The reported condition number will be different.

o added forgotten integer declaration in nwtcvg (nwutil.for).

o corrected documentation errors.


o negative values for stepmax (maximum stepsize) now imply no maximum stepsize. The default for stepmax (maximum stepsize) -1.0 so there is no maximum stepsize.

o removed the Levenberg-Marquardt correction for ill-conditioned or singular jacobians. The correction hardly ever gave sensible results. The algorithm now returns an error condition when a Jacobian is singular or ill-conditioned.


o fixed several incomplete last lines.


o corrected initialization bug. o corrected parameter error for Cauchy start in examples. o code cleaning to get rid of fortran statement labels.


o corrected missing/superfluous closing brackets in nleqslv.Rd.


o correct horrible bug caused by typo in nwnwtn causing dgeqrf to be called with an absurd value for the lwork argument. Typical fortran problem.


o use blocked Lapack QR routines. Significant speed increase for larger n (500+) in most cases.


o corrected wrong name for the flag for checking an analytical jacobian in nleqslv.R and the documentation.


o the default initial trust region size is now set to the length of the Newton step.

o corrected various errors in the documentation

  • the termination codes were a muddle.
  • several elements of the return list were incorrectly named in the documentation.


o initial version

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.