Bracketing

            Test codes are RobminSA\RobMinSA.vfproj and RobminSA\RobMinSA.DPR.  These are tested in ..\..\Fittery\robfit\TemplFit\eff where the codes are copied using

cprobminsa.bat

cprobminsad.bat

The test is

Nlfitmr bobdat.dir – tests the fortran version.

Nlfitmrd bobdat.dir – tests the Pascal version.

 

            Robmin finds a set of parameters, Cons(l), such that .  Finding these parameters involves inverting a matrix.  As the accuracy limit is approached, MatrixInverse\Cholesky\Singular.doc .htm, the matrix becomes nearly singular. 

 

Figure 1 Values of F(λ) from brack in the event that 0 is not crossed.  (Minimization with 12 constants and 400,1 in aigau.dir)

            The data in figure 1 is from the bracketing/bli section of Robmin in a case where F was never able to get to the low value requested.  It comes from an attempt to fit the complementary error function to 16 digit precision with a Pade approximate[*].  The Matrix inversion is multiple precision with enough digits to avoid the Pade approximate linear dependencies.  The value of F(λ) is not allowed to become bigger than 1 in figure 1, but it really is possibly as large as 1025 on the far left of figure 1.  Values on the nearly vertical point sets can extend from -1025 to 1025.  As lambda increases the right side of figure 1 looks much more like the function expected.

 

            The output in figure 1 is  as a “function” of l.  Finding Cons(l) requires inverting the second derivative array

 (1.1)

The SM in (1.1) is found from the result of the last successful[†] minimization as described in Smvals.doc .htm.  The points in figure 1 become smooth for values of l > 41 owing to the fact that with a sufficiently large diagonal matrix element, the matrix is invertible.  Figure 2 is a cartoon showing that there are two values of l for which .

The desired solution is the one to the right.  The first step in finding a solution involves finding a value of l to the right of where the blue line crosses the curve in figure 2.  This done by the first part of the brack subroutine in the codes RobminSA\uRobMin.pas or RobminSA\robmin.for

The first step in the brack procedure begins l0, the last successful value of l, a value of Dup is found such that the Range in the table below is given by .  A proper value of l in this step yields

(1.2)

The function Robmfu is defined as

(1.3)

This means that if the matrix cannot be inverted  (flag set) - or if the zero derivatives predict a maximum so that (cp2>c02) .

 

 

Figure 2 Modification of figure 1 to correspond to the definition in (1.3) with Fr = 0.5

        Brack first evaluates Robmfu, equation (1.3) at l0 for the last successful minimization.

  1. If the value of Robmfu(l0) is less than 0, Robmfu is evaluated for successive values of  where Dup is set to make lNtry = Range.  Once this becomes > 0, which should happen after only a few interpolations the values are turned over to Nraf which uses a modified Newton’s scheme for the final solution. 
  2. If the value of Robmfu(l0) is greater than 0, Robmfu is evaluated for successive values of  where Dum is set to make lNtry = -Range. 

a.       It usually happens that the blue line in figure 2 crosses the evaluations in the range above l = 37 in figure 2.  The first positive value and the first negative are then returned to Nraf for further processing as in 1.

b.      For a small value of Fr, the matrix becomes singular, or predicts a maximum, giving a negative value of -1 – Fr.  This is then returned to Nraf as in 1 above.  There are problems associated with the oscillations between l = 35 and 36 in figure 2, but Nraf is designed to converge on a minimum value somewhere between the input l’s with positive and negative values.

c.       In the case of the red line in figure 2, a minimum is predicted such that χ2m20 – Fr > 0.  There will not be a value less than 0.  The l giving the smallest value of  minimum predicted will not be the actual minimum until the final step, but there will be relatively few steps once this happens.  In this case the l with the smallest value of Robmfu is used to generate the constants for the next iteration without further modification.

Precision

Range

Ntry[‡]

Double

± 300

16

Extended

± 600

16

Quadruple

± 1200

16

Multiple precision

± 4800

16

            



[*] Pade approximates are nearly linearly dependent ..\..\Fittery\nlfit\LinDep.doc.

[†] Successful means that c2(l0) < χ20. When this is not true, it causes an IREV condition in which Robmin reads the last successful values of l and the constants back in. Owing to the near vertical lines in figure 1, if the next iteration starts at exactly the same value of l as the failed one, the result will move up the vertical line until a predicted success is reached or it jumps over the line.  The successes on the vertical lines occasionally cause robmin to suddenly decrease c2 by large amounts.

[‡] Surprisingly, the increased accuracy implies that more range can be handled.  The 16’s were determined in RobminSA\Welcome.doc .htm.