Difference between revisions of "Bfgs.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Update function See also links and function index membership)
(sync with Spinach main f053e432: Parameters/Outputs blocks aligned with head header)
 
Line 8: Line 8:
 
==Parameters==
 
==Parameters==
  
−
        dx_hist  - history of x increments, a stack
+
    dx_hist  - history of x increments, a stack
−
                  of column vectors, from the latest
+
              of column vectors, from the latest
−
                  to the earliest
+
              to the earliest
−
        dg_hist  - history of gradient increments,
+
−
                  a stack of column vectors, from
+
    dg_hist  - history of gradient increments,
−
                  the latest to the earliest
+
              a stack of column vectors, from
−
        g        - current gradient (used for sizing)
+
              the latest to the earliest
−
    Returns:
+
−
        H        - BFGS approximation to the Hessian
+
    g        - current gradient (used for sizing)
−
                  matrix corresponding to the *nega-
 
−
                  tive* Hessian of the objective.
 
−
                  The corresponding ascent directi-
 
−
                  on is obtained as:  direction=H\g
 
  
 
==Outputs==
 
==Outputs==
  
−
    this function produces output as described in source code
+
    H        - BFGS approximation to the Hessian
 +
              matrix corresponding to the *nega-
 +
              tive* Hessian of the objective.
 +
              The corresponding ascent directi-
 +
              on is obtained as:  direction=H\g
  
 
==Examples==
 
==Examples==

Latest revision as of 05:33, 30 August 2026

Calculates a BFGS approximation to the Newton-Raphson search direction for maximising a function using past gradients to build a serviceable substitute to a Hessian. Unlike LBFGS, the pseudo-Hessian matrix is formed explicitly.

Syntax

                    H=bfgs(dx_hist,dg_hist,g)

Parameters

   dx_hist  - history of x increments, a stack
              of column vectors, from the latest
              to the earliest

   dg_hist  - history of gradient increments,
              a stack of column vectors, from
              the latest to the earliest

   g        - current gradient (used for sizing)

Outputs

   H        - BFGS approximation to the Hessian
              matrix corresponding to the *nega-
              tive* Hessian of the objective.
              The corresponding ascent directi-
              on is obtained as:  direction=H\g

Examples

See examples in the Spinach distribution relevant to this function.

Notes

This page was generated from the function header in the Spinach repository.

See also

fmaxnewton.m, alpha_conds.m, bracketing.m, sectioning.m, cubic_interp.m, aux_mat.m, dirdiff.m, drifts.m, ensemble.m, hess_reorder.m, objeval.m, optimcon.m, trapdiff.m, Optimal_control_module

Version 2.11, authors: Ilya Kuprov