This is a version of the function in Numerical Recipes. It is initialized with a function value and gradient, and it does a series of quadratic searches until a convergence criterion is reached. This version includes code for display the progress of iteration for debugging purposes.
lnsrch(xold, fold, g, p, func, dataList, stpmax, itermax=20, TOLX=1e-10, dbglev=0)
A named list containing:
The parameter vector at the final minimum.
A boolean value indicating that problems were encountered.
The current parameter vector value.
The current function value.
The current gradient vector.
The current search direction vector.
The name of the function being optimized.
A list object containing objects specifying the function to be minimized.
The maximum step size.
The maximum number of iterations. Default 20
Convergence criterion.
The level of output. 0: no output; 1: function and slope at each iteration. 2 and above: also results within iteration.
Juan Li and James Ramsay
Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.
Press, W. H., Taukolsky, S. A., Vetterline, W. T. and Flannery, B. P. (2020) Numerical Recipes, Third Edition, Cambridge.
smooth.surp