Computes finite-difference approximation of gradient given input of arguments x and function fn
approx_grad(x, fn, eps = sqrt(.Machine$double.eps))
Numeric vector of finite-difference approximated gradient
Numeric vector of function arguments
Function returning list(objective, gradient)
Numeric scalar, finite difference tolerance
Used within efficient_bfgs
if needed externally, but internally, this function
is actually ignored since when VhalfInv_grad
is not supplied, stats::optim()
is used instead.