σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Calculus skill›Module 2 · Gradients and integrals›Topic 2.1·~45 minBeginner

Partial derivatives and gradients

Skill positionModule 2 of 4 · Topic 1 of 3
2.1 Partial derivatives and gradients
—Lab score— / 100Total XP—Streak—

Change in more than one direction

Most quantities in finance depend on several inputs at once. The value of a portfolio depends on every asset price; an option's price depends on the stock price, the volatility, the rate and the time. A partial derivative asks how the function changes when you move one input and hold all the others fixed.

∇f=(∂f∂x, ∂f∂y)\nabla f=\left(\frac{\partial f}{\partial x},\ \frac{\partial f}{\partial y}\right)∇f=(∂x∂f​, ∂y∂f​)(1)

Collect all the partial derivatives in a vector and you get the gradient ∇f\nabla f∇f. It points in the direction of steepest increase, its length is the steepest rate of increase, and a small move Δx\Delta\mathbf{x}Δx changes the function by about ∇f⋅Δx\nabla f\cdot\Delta\mathbf{x}∇f⋅Δx. Gradient descent, which trains most machine-learning models, simply steps against the gradient.

A gradient by handFor f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2f(x,y)=x2y+3y2: fx=2xyf_x=2xyfx​=2xy (treat yyy as a constant) and fy=x2+6yf_y=x^2+6yfy​=x2+6y (treat xxx as a constant). At (1,2)(1,2)(1,2) the gradient is (4,13)(4,13)(4,13). A move of (+0.1,−0.05)(+0.1,-0.05)(+0.1,−0.05) changes fff by about 4(0.1)+13(−0.05)=−0.254(0.1)+13(-0.05)=-0.254(0.1)+13(−0.05)=−0.25.
  • Partial derivative fxf_xfx​: the rate of change in xxx with the other inputs held fixed.
  • Gradient ∇f\nabla f∇f: the vector of all partial derivatives.
  • Steepest ascent: the direction of ∇f\nabla f∇f; its length ∥∇f∥\|\nabla f\|∥∇f∥ is the steepest rate.
  • First-order change: Δf≈∇f⋅Δx\Delta f\approx\nabla f\cdot\Delta\mathbf{x}Δf≈∇f⋅Δx for a small move.
A partial derivative is not a total derivative∂C∂S\frac{\partial C}{\partial S}∂S∂C​ (the delta of an option) holds the volatility, rate and time fixed, but in a real market the volatility often moves when the price moves. The partial derivative is a clean building block, not the whole story of how the price reacts.

Lab · what's graded

  • Partial in x15 pts
  • Partial in y15 pts
  • The gradient at a point15 pts
  • The steepest rate15 pts
  • What the gradient points to10 pts
  • Computing a gradient10 pts
  • Holding the others fixed20 pts
0/ 7 answered
Tasks
1Expression15 ptsNot answered

Let f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2f(x,y)=x2y+3y2. Type ∂f∂x\frac{\partial f}{\partial x}∂x∂f​.

fx=f_x =fx​=
Your formula appears here
2Expression15 ptsNot answered

Let f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2f(x,y)=x2y+3y2. Type ∂f∂y\frac{\partial f}{\partial y}∂y∂f​.

fy=f_y =fy​=
Your formula appears here
3Matrix · vector15 ptsNot answered

Let f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2f(x,y)=x2y+3y2. Fill in the gradient ∇f(1,2)\nabla f(1,2)∇f(1,2) as a column.

∇f(1,2)=\nabla f(1,2) =∇f(1,2)=
4Numeric answer15 ptsNot answered

For g(x,y)=x2+y2g(x,y)=x^2+y^2g(x,y)=x2+y2 at the point (3,4)(3,4)(3,4), what is the largest possible rate of increase, ∥∇g∥\|\nabla g\|∥∇g∥?

∥∇g∥=\|\nabla g\| =∥∇g∥=accepted: ± 0.001
5Choice10 ptsNot answered

In which direction does ∇f\nabla f∇f point?

6Order the steps10 ptsNot answered

Put the steps of computing a gradient at a point in order.

Drag to reorder, or focus an item, press Space to lift it, the arrow keys to move it and Space to drop it.

  1. 1Substitute the point into each partial derivative
  2. 2Differentiate with respect to each variable, holding the others fixed
  3. 3Stack the results into a vector
  4. 4Write each partial derivative as a formula
7Explain in words20 ptsNot answered

In two or three sentences, explain what a partial derivative measures, why the other variables are held fixed, and what the gradient adds.

Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub