Many outputs, many inputs
A function F can map several inputs to several outputs, for example risk factors to the values of several positions. Its Jacobian J is the matrix of all first partial derivatives, with entry Jij=∂xj∂Fi. It is the best linear approximation: for a small move Δ, F(x+Δ)≈F(x)+JΔ.
J=(∂x∂F1∂x∂F2∂y∂F1∂y∂F2)(1) For one output f, the second derivatives form the Hessian H, with Hij=∂xi∂xj∂2f. For smooth functions it is symmetric. It describes curvature: f(x+Δ)≈f+∇f⋅Δ+21ΔTHΔ. Where ∇f=0, a positive definite H marks a local minimum, a negative definite H a local maximum, and a mixed one a saddle point. Newton's method for optimisation uses H to take better steps than plain gradient descent.
A Jacobian and a Hessian by handFor
F(x,y)=(x2y, x+y2):
J=(2xy1x22y), so at
(1,2) it is
(4114) with determinant 15: small areas are scaled by about 15. For
f(x,y)=x2y+y2:
fxx=2y,
fxy=2x,
fyy=2, so at
(1,2) the Hessian is
(4222).
- Jacobian: the matrix of first partials of a vector function; the best linear model of it.
- Hessian: the symmetric matrix of second partials of a scalar function; its curvature.
- Positive definite Hessian at a critical point: a local minimum.
Do not estimate a Hessian by finite differences if you can avoid itSecond differences divide tiny differences by h2, which magnifies rounding noise. Prefer formulas or automatic differentiation, and when you must use differences, check that the result is symmetric. Lab · what's graded
- The Jacobian at a point20 pts
- The Hessian at a point20 pts
- The determinant of the Jacobian15 pts
- Reading a Hessian15 pts
- The linear approximation15 pts
- What each matrix describes15 pts