Hessian
Definition
If you have a real-valued function
f:Rd→R
The Hessian matrix of f at a point w∈Rd is the square matrix of all second-order partial derivaties:
H(w)=∇2f(w)=∂w12∂2f∂w2∂w1∂2f⋮∂wd∂w1∂2f∂w1∂w2∂2f∂w22∂2f⋮∂wd∂w2∂2f⋯⋯⋱⋯∂w1∂wd∂2f∂w2∂wd∂2f⋮∂wd2∂2f
- Entry Hij=∂wi∂wj∂2f
- If f is smooth, the Hessian is symmetric (Hab=Hba)
Tip
What does “smooth” mean?
f∈C2(Rd)
- f has continuous first and second derivatives s.t.
∂wi∂wj∂2f=∂wj∂wi∂2f∀i,j
Geometric Meaning
-
The gradient ∇f(w) tells you the slope/direction of the steepest ascent
-
The Hessian tells you about the curvature
-
How much the slope changes as you move
-
Whether the current surface bends upwards (convex), downwards (concave), or in a saddle point.

Tip
Second derivative test
⎩⎨⎧concave, local maximum(f′′(x)<0)convex, local mimimum(f′′(x)>0)saddle point(f′′(x)=0)
⎩⎨⎧D=0(inconclusive)D<0(saddlepoint)D>0,fxx>0(local minimum)D>0,fxx<0(local maximum)
Definiteness and Curvature
A way to classify the nature of a point
- Positive Definite (PD)
- z⊺Hz>0,∀z=0
- function curves upward everywhere (local minimum)
- Negative Definite (ND)
- z⊺Hz<0,∀z=0
- function curves downwards everywhere (local maximum)
- Positive Semi-definite (PSD)
- z⊺Hz≥0,∀z=0
- function curves upward (convex) but may be flat in some directiosn
- Negative Semi-definite (NSD)
- z⊺Hz≤0,∀z=0
- function curves downward (concave) but may be flat in some directiosn
- Indefinite
- Some directions curve up, others down.
| Type | Quadratic form | Eigenvalues condition | Geometry |
|---|
| Positive definite (PD) | (>0) for all (z=0) | All (λ>0) | Strict convex bowl |
| Positive semi-definite (PSD) | (≥0) for all (z) | All (λ≥0) | Convex, flat possible |
| Negative definite (ND) | (<0) for all (z=0) | All (λ<0) | Strict concave dome |
| Negative semi-definite (NSD) | (≤0) for all (z) | All (λ≤0) | Concave, flat possible |
| Indefinite | Both positive and negative values | Mix of + and – eigenvalues | Saddle |