Skip to content

numericalGradient

numericalGradient(f, x, options?): number[]

Defined in: numdiff.js:14

Approximate the gradient of a scalar function by central finite differences.

Parameters

f

Function

Scalar function (x: Array) => number

x

number[]

Point at which to evaluate the gradient

options?

h?

number

Step size

Returns

number[]

Gradient approximation