next up previous
Next: A.2 Evaluation of Constraint Up: A.1 Basic Fitting Algorithm Previous: A.1.8 Directed Steps

A.1.9 Summary of Fitting Algorithm

  1. The inputs are the vectors of measured values , , the initial starting point for the fit , , and the error matrices and . There's also a constraint function constraint_fcn, which takes a point , and returns the values of the constraints and their gradients and .

  2. Call constraint_fcn for the initial values of and to get the initial values for , , and . If the initial starting point is rejected by constraint_fcn as invalid, return an error status.

  3. Initialize - and - .

  4. For each iteration:  

  5. Compute , , and - .

  6. Solve the set of equations for and . Also remember the matrices , , and , defined by the equations .

  7. Compute the new value of and by and . In case the step needs to be cut, compute the value of by .

  8. Compute the trial destination of this step, , , by + and + .

  9. Initialize the total cut size for this step, .

  10. Call constraint_fcn at , . If constraint_fcn rejects the point, the step must be cut, as described below. Compute the sum of the absolute values of the constraint functions, constraint_sum. If it has decreased since the last step, or if it is below the convergence threshold constraint_sum_eps, the step is accepted. The first step is accepted no matter what the constraint functions are doing. Otherwise, the constraints have increased, and the step should be cut:  

    1. If this is the first attempt to cut this step, test to see if the is stationary. If , try a directed step:

      1. Solve the set of equations for and , using the values of and from the beginning of the step. Also remember , , and , as before.

      2. Compute .

      3. Compute the destination of the directed step by + + and + + .

      4. Call constraint_fcn. If , is an acceptable point and the value of constraint_sum is now less than the value on the previous step, then accept the directed step and make the assignments

        • -
        • -

        Otherwise, continue with the attempt to cut the step.

    2. If too many attempts have already been made to cut this step, give up and return an error.

    3. Set up the size by which to cut this step, . Normally, this is set to a constant cutsize. However, it is fairly common to have a number of steps in a row, all of which get cut to about the same size. To speed up this case, remember the total cut size from the last step. If this is the first cut for this step, and the last step was also cut, set to twice the final cut size from the last step, provided that this value is less than cutsize.

    4. Compute the the new total cut size for this step by using the assignment . If the total cut size falls below a threshold,
      , give up and return an error.

    5. Cut the step, by and .

    6. Calculate the new and from (A.56) and (A.58), and the new and from + and + .

    7. Return to step 10 to test the cut step.

  11. At this point, there's an acceptable step. Shuffle the variables around to prepare for the next step:

  12. Test for convergence by requiring that the system satisfy
    and for two iterations in a row. If these conditions are satisfied, exit the fit loop and go to step 15.

  13. Count the total number of steps taken. If it exceeds maxit, give up and return an error.

  14. Return to step 4 for the next iteration.

  15. This fit has succeeded. Calculate the error matrices and from (A.38) and (A.40), and the vectors of pull functions and from (A.48) and (A.50).  



next up previous
Next: A.2 Evaluation of Constraint Up: A.1 Basic Fitting Algorithm Previous: A.1.8 Directed Steps



Scott Snyder Fri May 19 19:19:46 CDT 1995