View source: R/derivative_matrices.R
| vc_jacobian | R Documentation |
Approximate the Jacobian of a vector-valued function
vc_jacobian(
f,
point,
method = "central",
h = NULL,
atol = 1e-08,
rtol = 1e-04,
warn = TRUE
)
f |
Deterministic function accepting one finite coordinate vector and returning a nonempty finite real vector of fixed dimension and names. Optional output names must be unique and nonempty. A scalar output is allowed and produces a one-row Jacobian. |
point |
Nonempty finite real coordinate vector. Optional names must be unique and nonempty and are passed to f. |
method |
One difference method, or one per coordinate. Explicit one-sided methods can be used at known coordinate-domain boundaries. |
h |
NULL for per-coordinate vc_derivative heuristics, one positive finite step for all coordinates, or a positive finite vector of that dimension. No recycling of shorter vectors is allowed. |
atol |
Nonnegative finite absolute tolerance for sensitivity comparisons. |
rtol |
Nonnegative finite relative tolerance for sensitivity comparisons. |
warn |
Logical scalar; warn when sensitivity diagnostics fail. |
Reuses vc_derivative on each output/coordinate restriction, with shared cached vector evaluations. It does not guess f(x,y) signatures or silently recycle output dimensions. All three relative refinement levels are retained. Entry checks do not prove total differentiability, bound matrix error or establish a chain-rule hypothesis. One-sided differences are labeled and provide only their selected coordinate-side evidence.
Plain list with type, point, value, estimate (outputs by inputs), reliable (logical matrix), all_reliable, table, results (per-entry full derivative diagnostics), refinements (three estimate matrices), evaluation_count and note. Matrix names follow output/point names, or default to f1,... and x1,... . Table rows identify output and input index, labels, method, initial step, estimate, stable and reliable.
f <- function(v)c(first=v[1]^2+v[2],second=v[2]*v[3])
f |> vc_jacobian(c(1,2,3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.