Learn R Programming

cgraph (version 3.0.1)

approx_grad: Approximate Gradients

Description

Differentiate node x with respect to node y by numerical differentiation.

Usage

approx_grad(x, y, index = 1, eps = 1e-04)

Arguments

x

character scalar, name of the node.

y

character scalar, name of the node.

index

numeric scalar, index of the target node that is differentiated. Defaults to the first element.

eps

numeric scalar, step size. Defaults to 1e-4.

Value

numeric vector or array, the derivative of x with respect to y.