Skip to content
Calculus II: Vector Calculus and Multivariable Analysis / Multivariable Differential Calculus

The Gradient Vector and Directional Derivatives

A risk manager standing at today's portfolio weights wants to know: in which direction should weights shift to increase the Sharpe ratio fastest? In which direction does drawdown risk decrease fastest? The answer is the gradient — the vector that points in the direction of steepest ascent of any scalar field. More generally, the directional derivative DufD_\mathbf{u} f measures how rapidly ff changes as we move a unit distance in direction u\mathbf{u}, generalising partial derivatives from the coordinate directions to any direction. The gradient ∇f\nabla f is perpendicular to every level curve of ff — which is why gradient descent always crosses contours at right angles, making it the most efficient first-order search direction.
Learning objectives. By the end of this note you should be able to:
  • define the directional derivative Duf(P0)D_\mathbf{u} f(P_0) and compute it using Duf=∇f⋅uD_\mathbf{u} f = \nabla f \cdot \mathbf{u};
  • compute the gradient ∇f=(fx,fy)\nabla f = (f_x, f_y) for functions of two variables and ∇F=(Fx,Fy,Fz)\nabla F = (F_x, F_y, F_z) for three variables;
  • find the direction of steepest ascent and steepest descent at a point;
  • prove that ∇f\nabla f is perpendicular to the level curve {f=c}\{f = c\} at any point;
  • apply gradient descent logic to portfolio optimisation.

In this lesson

    1. The Directional Derivative
    1. The Gradient
    1. Direction of Greatest Increase and Decrease
    1. The Gradient is Perpendicular to Level Curves
    1. Gradient in Three Variables
    1. Gradient Descent in Finance

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.