linalg::hessian
-- Hessian
matrix of a scalar functionlinalg::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).
linalg::hessian(f,x)
f |
- | an arithmetical expression (the scalar function) |
x |
- | a list of (indexed) identifiers |
a matrix of the domain Dom::Matrix()
.
diff
, linalg::grad
, linalg::jacobian
The 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 | +- -+
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.