| hessian | R Documentation |
Computes the matrix of second partial derivatives of f at x
using forward-mode AD. Equivalent to D(f, x, order = 2).
hessian(f, x)
f |
A function taking a parameter vector and returning a scalar. |
x |
A numeric vector of parameter values. |
A p x p numeric matrix (the Hessian).
f <- function(x) -(x[1] - 3)^2 - (x[2] - 5)^2
hessian(f, c(1, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.