gradient0 {fntl} | R Documentation |
Numerical Gradient Vector
Description
Numerical Gradient Vector
Usage
gradient0(f, x, args)
Arguments
f |
Function to differentiate. |
x |
Vector at which to evaluate the gradient. |
args |
List of additional arguments from the function |
Value
A list with the form of a gradient_result
described in section "Gradient"
of the package vignette.
Examples
f = function(x) { sum(sin(x)) }
args = richardson_args()
x0 = seq(0, 1, length.out = 5)
cos(x0) ## Exact answer
gradient0(f, x0, args)
numDeriv::grad(f, x0)
[Package fntl version 0.1.2 Index]