Option greeks are essential to every options trader. But, what are the greeks precisely? The greeks are the partial-derivatives of the Black-Scholes equation with respect to each variable…

**The Greeks**

- Delta — Δ — first partial-derivative with respect to the underlying asset
- Gamma — γ — 2nd partial-derivative with respect to the underlying asset
- Vega —
*v* — partial-derivative with respect to volatility
- Theta — θ — partial-derivative with respect to time until expiration
- Rho — ρ — partial derivative with respect to the given interest rate

In plain English, the greeks tell us how an option’s price changes when only that parameter is varied (all others are held constant). Trading platforms often compute the greeks automatically for each contract. However, when streaming market data to Python, or with your own pricing models, you will need to compute these values on your own. Though there are closed-form solutions for Black-Scholes greeks (which *dramatically* speed up their computation). Nevertheless, I thought it would be a cool introduction to the Python library JAX which can be used to automatically compute the gradient for any function.

The beauty of JAX derived greeks is that it can be used for any pricing model, not just the Black-Scholes model making hedging exotics a little less painful.

## What is the gradient vector?

The gradient vector, or simply the *gradient*, is the collection of partial-derivatives for any given multivariable function.

Given the following function *f*…

The gradient — ∇ — is the following…

This notion follows for all functions regardless of dimensionality…

For more information regarding the gradient check out The Gradient Vector.

#finance #programming #economics #artificial-intelligence #python