generateGrid2 {pnd} | R Documentation |
Generate grid points for Hessians
Description
Creates a list of unique evaluation points for second derivatives: both
diagonal (\partial^2 / \partial x_i^2
) and cross
(\partial^2 / \partial x_i \partial x_j
).
Usage
generateGrid2(x, side, acc.order, h)
Arguments
x |
Numeric vector or scalar: the point(s) at which the derivative is estimated.
|
side |
Integer scalar or vector indicating the type of finite difference:
|
acc.order |
Integer or vector of integers specifying the desired accuracy order
for each element of |
h |
Numeric or character specifying the step size(s) for the numerical
difference or a method of automatic step determination ( |
Value
A list with elements:
-
xlist
: a list of unique coordinate shifts, -
w
: the finite-difference weights (one per point), -
i1
,i2
: integer vectors giving partial-derivative indices.
The length of each vector matches xlist
.
See Also
Examples
generateGrid2(1:4, side = rep(0, 4), acc.order = c(2, 6, 4, 2),
h = c(1e-5, 1e-4, 2e-5, 1e-6))