title: Symmetric rank-one
text: # Symmetric rank-one
  
  The Symmetric Rank 1 (SR1) method is a quasi-Newton method to update the second derivative (Hessian) based on the derivatives (gradients) calculated at two points. It is a generalization to the secant method for a multidimensional problem. This update maintains the symmetry of the matrix but does not guarantee that the update be positive definite.
  
  The sequence of Hessian approximations generated by the SR1 method converges to the true Hessian under mild conditions, in theory; in practice, the approximate Hessians generated by the SR1 method show faster progress towards the true Hessian than do popular alternatives (BFGS or DFP), in preliminary numerical experiments. The SR1 method has computational advantages for sparse or partially separable problems.
  
  A twice continuously differentiable function $x\mapsto f(x)$ has a gradient ($\nabla f$) and Hessian matrix $B$: The function $f$ has an expansion as a Taylor series at $x_{0}$, which can be truncated
  
         $f(x_{0}+\Delta x)\approx f(x_{0})+\nabla f(x_{0})^{T}\Delta x+{\frac {1}{2}}\Delta x^{T}{B}\Delta x$;
  
  its gradient has a Taylor-series approximation also
  
         $\nabla f(x_{0}+\Delta x)\approx \nabla f(x_{0})+B\Delta x$,
  
  which is used to update $B$. The above secant-equation need not have a unique solution $B$. The SR1 formula computes (via an update of rank 1) the symmetric solution that is closest to the current approximate-value $B_{k}$:
  
         $B_{k+1}=B_{k}+{\frac {(y_{k}-B_{k}\Delta x_{k})(y_{k}-B_{k}\Delta x_{k})^{T}}{(y_{k}-B_{k}\Delta x_{k})^{T}\Delta x_{k}}}$,
  
  where
  
         $y_{k}=\nabla f(x_{k}+\Delta x_{k})-\nabla f(x_{k})$.
  
  The corresponding update to the approximate inverse-Hessian $H_{k}=B_{k}^{-1}$ is
  
         $H_{k+1}=H_{k}+{\frac {(\Delta x_{k}-H_{k}y_{k})(\Delta x_{k}-H_{k}y_{k})^{T}}{(\Delta x_{k}-H_{k}y_{k})^{T}y_{k}}}$.
  
  One might wonder why positive-definiteness is not preserved — after all, a rank-1 update of the form $B_{k+1}=B_{k}+vv^{T}$ is positive-definite if $B_{k}$ is. The explanation is that the update might be of the form $B_{k+1}=B_{k}-vv^{T}$ instead because the denominator can be negative, and in that case there are no guarantees about positive-definiteness.
  
  The SR1 formula has been rediscovered a number of times. A drawback is that the denominator can vanish. Some authors have suggested that the update be applied only if
  
         $|\Delta x_{k}^{T}(y_{k}-B_{k}\Delta x_{k})|\geq r\|\Delta x_{k}\|\cdot \|y_{k}-B_{k}\Delta x_{k}\|$,
  
  where $r\in (0,1)$ is a small number, e.g. $10^{-8}$.
  
  