gradient0 | R Documentation |
Numerical Gradient Vector
gradient0(f, x, args)
f |
Function to differentiate. |
x |
Vector at which to evaluate the gradient. |
args |
List of additional arguments from the function |
A list with the form of a gradient_result
described in section "Gradient"
of the package vignette.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.