Learn R Programming

dfdr (version 0.2.0)

hessian: Compute the Hessian-function of a function.

Description

Creates a function that computes the second-order derivatives of a function with respect to each pair of parameters and return a vector of these.

Usage

hessian(f, use_names = FALSE, ...)

Value

A function that computes the gradient of f at any point.

Arguments

f

A function

use_names

Should the gradient add variable names to the output of the function?

...

The variable names for which gradients should be calculated

Examples

Run this code
f <- function(x, y) x**2 + y**2
h <- hessian(f, FALSE, x, y)
h(0, 0)

Run the code above in your browser using DataLab