View source: R/HelperFunctions.R
approx_grad | R Documentation |
Computes finite-difference approximation of gradient given input of arguments x and function fn
approx_grad(x, fn, eps = sqrt(.Machine$double.eps))
x |
Numeric vector of function arguments |
fn |
Function returning list(objective, gradient) |
eps |
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.
Numeric vector of finite-difference approximated gradient
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.