>  Docs Center  >  Libraries  >  ASTROLIB  >  MINF_CONJ_GRAD
Libraries

MINF_CONJ_GRAD

MINF_CONJ_GRAD

Name


        MINF_CONJ_GRAD

Purpose


      Find the local minimum of a scalar function using conjugate gradient

Explanation


      Find the local minimum of a scalar function of several variables using
      the Conjugate Gradient method (Fletcher-Reeves-Polak-Ribiere algorithm).
      Function may be anything with computable partial derivatives.
      Each call to minF_conj_grad performs one iteration of algorithm,
      and returns an N-dim point closer to the local minimum of function.
  CALLING EXAMPLE:
      p_min = replicate( 1, N_dim )
      minF_conj_grad, p_min, f_min, conv_factor, FUNC_NAME="name",/INITIALIZE
      while (conv_factor GT 0) do begin
              minF_conj_grad, p_min, f_min, conv_factor, FUNC_NAME="name"
      endwhile

Inputs


      p_min = vector of independent variables, location of minimum point
              obtained from previous call to minF_conj_grad, (or first guess).

Keywords


      FUNC_NAME = function name (string)
              Calling mechanism should be: F = func_name( px, gradient )
        where:
              F = scalar value of function at px.
              px = vector of independent variables, input.
              gradient = vector of partial derivatives of the function
                      with respect to independent variables, evaluated at px.
                      This is an optional output parameter:
                      gradient should not be calculated if parameter is not
                      supplied in call (Unless you want to waste some time).
      /INIT must be specified on first call (whenever p_min is a guess),
                      to initialize the iteration scheme of algorithm.
      /USE_DERIV causes the directional derivative of function to be used
                      in the 1-D minimization part of algorithm
                      (default is not to use directional derivative).
      TOLERANCE = desired accuracy of minimum location, default=sqrt(1.e-7).
      /QUADRATIC runs simpler version which works only for quadratic function.

Outputs


      p_min = vector giving improved solution for location of minimum point.
      f_min = value of function at p_min.
      conv_factor = gives the current rate of convergence (change in value),
                      iteration should be stopped when rate gets near zero.

External Calls


      pro minF_bracket, to find 3 points which bracket the minimum in 1-D.
      pro minF_parabolic, to find minimum point in 1-D.
      pro minF_parabol_D, to find minimum point in 1-D, using derivatives.

Common Blocks


      common minf_conj_grad, grad_conj, grad_save, gs_norm
      (to keep conjugate gradient, gradient and norm from previous iteration)

Procedure


      Algorithm adapted from Numerical Recipes, sec.10.6 (p.305).
      Conjugate gradient is computed from gradient, which then gives
      the best direction (in N-dim space) in which to proceed to find
      the minimum point. The function is then minimized along
      this direction of conjugate gradient (a 1-D minimization).
      The algorithm is repeated starting at the new point by calling again.

Modification History


      Written, Frank Varosi NASA/GSFC 1992.
      Converted to IDL V5.0 W. Landsman September 1997



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us