Learn R Programming

lgspline (version 0.2.0)

approx_grad: Finite-difference Gradient Computer

Description

Computes finite-difference approximation of gradient given input of arguments x and function fn

Usage

approx_grad(x, fn, eps = sqrt(.Machine$double.eps))

Value

Numeric vector of finite-difference approximated gradient

Arguments

x

Numeric vector of function arguments

fn

Function returning list(objective, gradient)

eps

Numeric scalar, finite difference tolerance

Details

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.