Scaling in newt()


rboesch
03-19-2015, 02:20 PM
Hello all,

In section 9.7, (NR in C, 2ndEd) it's noted that the components of x and F should be rescaled to near unity to avoid root convergence problems. Assume this rescaling is done.

In newt(), a value is assigned to the scaling parameter stpmax which is subsequently used in lnsrch() to adjust the length of the x-increment vector p so that |p| = stpmax where

stpmax = STPMX * max(|x|, n),

STPMX = 100 and n is the dimension of x. This shows stpmax is of order 100, or higher depending on the value of n.

Since the full Newton step |p| is taken initially, the initial step also has order 100. This means that the initial guess for the root (which has order 1) is updated to a new guess of order 100.

Is the choice for the value of STPMX defeating the purpose of the original scaling? Is there a reason it was chosen to be this large? Similarly, is the dependence of stpmax on n also at odds with the rescaling, assuming n >= 10?

Of course, different choices of STPMX will locate different roots given the same initial guess. It's easy to demonstrate that with several roots available, an initial guess near one root will allow convergence to another root further away if STPMX= 100, whereas if STPMX=1 convergence on the nearer root takes place. But my question is more about algorithm stability and rationale behind choosing STPMX=100, and the dependence of stpmax on n.

Many thanks,
Rick

Saul Teukolsky
03-19-2015, 02:51 PM
Hi Rick,

The scaling in lnsrch is done only if the proposed step direction p is bigger than stpmax, in which it is scaled to stpmax. So most of the time no new scaling is done and this is merely a safeguard if you use the routine with badly scaled variables.

As for allowing a value of order 100: "Badly scaled" usually means numbers approaching 10^(16) being compared with numbers of order unity, when you are likely to lose numerical precision. A factor of 100 is usually nothing to worry about.

Hope this helps.

Saul Teukolsky

rboesch
03-20-2015, 08:33 AM
Hi Saul,

Of course! The if condition is plainly in the text, yet escaped making it to the source. All clear.

Appreciate the helpful and speedy reply.

Best regards,
Rick