| vc_differential | R Documentation |
Approximate dy = f'(x0) * dx and compare it with the actual sampled change delta_y = f(x0 + dx) - f(x0). The differential is a local linear approximation; it is generally different from the finite change.
vc_differential(
f,
x0,
dx,
method = c("central", "forward", "backward"),
h = NULL,
atol = 1e-08,
rtol = 1e-04,
warn = TRUE
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
x0 |
Finite real scalar evaluation point of the local model. |
dx |
Finite real scalar displacement. Zero and negative values are allowed. For nonzero dx, x0 + dx must be finite and distinct from x0. |
method |
One of "central", "forward", or "backward". |
h |
Positive finite real initial derivative step, or NULL for the heuristic used by vc_derivative(), evaluated with x = x0. |
atol |
Nonnegative finite absolute tolerance for sensitivity comparisons. |
rtol |
Nonnegative finite relative tolerance for sensitivity comparisons. |
warn |
Logical scalar; warn when sensitivity diagnostics fail. |
In exact mathematics, differentiability implies delta_y = f'(x0)*dx + o(abs(dx)) as dx tends to zero. Here the slope is numerical: remainder includes derivative approximation and rounding errors, and is not a rigorous Taylor error bound. The function must be finite at x0 + dx, as well as at the derivative stencil. One-sided derivative choices do not certify a two-sided differential.
Plain list with type ("differential"), x0, y0, x1, y1, dx, dy, delta_y, remainder (delta_y - dy), tangent (full vc_tangent result), and note. dx is the requested displacement; actual_dx is the representable x1 - x0, also returned. The difference can matter at floating-point scale.
vc_differential(function(x) x^2, 1, dx = 0.1)
sin |> vc_differential(x0 = 0, dx = -0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.