linalg::hessian -- Hessian
matrix of a scalar function
Introductionlinalg::hessian(f, x) computes the Hesse
matrix (the Hessian) of the scalar function f(x) in
Cartesian coordinates, i.e., the square matrix of second partial
derivatives of f(x).
Call(s)linalg::hessian(f,x)
Parametersf |
- | an arithmetical expression (the scalar function) |
x |
- | a list of (indexed) identifiers |
Returnsa matrix of the domain Dom::Matrix().
Related
Functionsdiff, linalg::grad, linalg::jacobian
Example
1The Hessian of the function f(x,y,z)=x*y + 2*x*z is the following matrix:
>> delete x, y, z: linalg::hessian(x*y + 2*z*x, [x, y, z])
+- -+
| 0, 1, 2 |
| |
| 1, 0, 0 |
| |
| 2, 0, 0 |
+- -+
Background
Hf(x):=
+- -+
| diff(f(x),x1,x1) diff(f(x),x2,x1) ... diff(f(x),xp,x1) |
| |
| diff(f(x),x1,x2) diff(f(x),x2,x2) ... diff(f(x),xp,x2) |
Hf(x):= | |
| : : : |
| |
| diff(f(x),x1,xp) diff(f(x),x2,xp) ... diff(f(x),xp,xp) |
+- -+
is called the Hesse matrix of f.