## Damped Newton-Raphson

Given a function*:*

**f***R*→

^{n}*R*the damped Newton-Raphson's method attempts to find a location of a local minimum of

*f*. The damped Newton-Raphson is an iterative method which when given a point

*∈*

**x**_{0}*R*seeks a critical point in the direction given by the Newton-Raphson procedure in the event that the Hessian,

^{n}*H*, of

*f*is positive definite at

*otherwise it seeks a critical point in the direction given by the method of steepest-descent. If the direction is given by the Newton-Raphson method, then the (unnormalized) direction*

**x**_{0}*=*

**d***H*and if the direction is given by the method of steepest descent, then the (unnormalized) direction is

^{-1}**grad**f*=*

**d***. If the direction is given by the Newton-Raphson method, then set λ = 1 and if the direction is given by the method of steepest descent, then set λ =*

**grad**f*(*providing that

**grad**f)^{T}H (**grad**f)*(*> 0 otherwise set

**grad**f)^{T}H (**grad**f)λ =

*max*historical step length / ||

*|| unless there is no history in which case set λ = 1. The function*

**d***f*is then evaluated at

*and if*

**x**_{0}- λ d*f*(

*) >*

**x**_{0}- λ d*f*(

*) then halve λ and try again otherwise replace*

**x**_{0}*by*

**x**_{0}*. The process is halted by a user-defined function of the displacement between successive iterations, the gradient evaluated at the current estimate, and the total number of iterations performed.*

**x**_{0}- λ dIt is possible that the procedure converges to a saddle point and therefore the result needs to be checked as to whether it is a location of a local minimum or not.

### Function List

- int Damped_Newton_Raphson( double (*f)(double *), void (*df)(double*, double*), void (*ddf)(double*, double*, double*), int (*Stopping_Rule)(double*, double*, int, int), double* a, int n )

This routine uses the damped Newton-Raphson method to approximately locate a local minimum of the function*f (*. The user-supplied function**x**)*df*(*x*,*fx*), the gradient of*f (*, has two arguments, the first is the location**x**)**x**where the gradient is evaluated and the second is the array whose*i*component is the^{th}*i*component of^{th}. The user-supplied function**grad**f (**x**)*ddf*corresponds to the Hessian of*f (*.**x**)*ddf*(*x*,*fx*,*dfx*) has three arguments, the first is the location**x**where the function is evaluated, the second is the gradient which is included to facilitate the evaluation of the Hessian in the event the Hessian depends explicitly on the value, and the third argument is the Hessian**grad**f (**x**)*n x n*matrix whose*i,j*element is ∂^{2}f / ∂x_{i}∂x_{j}evaluated at. The arguments to the user-supplied**x***stopping_rule*are: the displacement vectorbetween two successive iteratates, the gradient evaluated at the new estimate**d****x**, the total number of iterations performed, and*n*the dimension of. The user-supplied**x***stopping_rule*should return a non-zero, either positive or negative, integer to halt the procedure and return zero to continue iterating, the return value -1 is an intrinsic return value used by the damped Newton-Raphson routine. Upon exiting the function returns either the return of the user-supplied*stopping-rule*or a -1 indicates that there was not enough dynamic heap memory. The argument*a*upon input is the initial*n*-dimensional point and upon exiting is the final estimate of the location of a local minimum.

*C* Source Code

- The file, damped_newton_raphson.c, contains the version of Damped_Newton_Raphson( ) written in
*C*.