R/calibrar-gradient.R
gradient.Rd
This function calculates the gradient of a function, numerically, including the possibility of doing it in parallel.
gradient(fn, x, method, control, parallel, ...)
The function to calculate the gradient.
The value to compute the gradient at.
The method used. Currently implemented: central, backward, forward and Richardson. See details.
A list of control arguments.
Boolean, should numerical derivatives be calculated in parallel?
Additional arguments to be passed to fn
.
The gradient of fn
at x
.
gradient(fn=function(x) sum(x^3), x=0)
#> [1] 0