Wednesday, November 28, 2012

Monday, November 26, 2012

How to derive the Black-Scholes PDE

The Black Scholes equation of course is one of the most important equations for financial engineering. However it is not so straight forward, so memorizing it is a bit difficult. So today I decide to derive it from scratch.

The equation goes like this:

$$ \frac{\partial V}{\partial t} + \frac12 \sigma^2 S^2 \frac{\partial^2 V }{\partial S^2} + (r - d) S \frac{\partial V}{\partial S} - rV =  0 $$

Let's get started.

1. the stochastic differential equation that drives stock price: $ dS = S (r dt + \sigma dW) $
It's a bit not precise to say 'drive' since the mechanism behind stock price is like a black box. But anyway this is not the point. Start from here we have:
$$ dS^2 = S^2 ( r dt + \sigma dW)^2 = S^2 ( \sigma^2 dt + 2 r \sigma dt dW + r^2 dt^2) $$
By Ito's lemma, both $ dt dW $ term and $ dt^2 $ terms goes small compared to $ dt $.
So : $ d S^2 = S^2 \sigma^2 dt^2 $

2. Using Taylor's expansion, $ d F = \frac{dF}{dS} dS + \frac12 \frac{d^2 F}{dS^2} dS^2 $
So for an option whose price is a function of stock price, we have:
$$ d V = \frac{dV}{dS} dS + \frac12 \frac{d^2 V}{dS^2} dS^2 $$
Simplify it:
$$ d V = \Delta ( r dt + \sigma dW) + \frac12 \Gamma (S^2 \sigma^2 dt^2) $$
Where $\Delta$ and $\Gamma$ are the hedge ratio and the greeks relatively.

3. A portfolio of one option and $\Delta$ shares of stock. $\Pi = V - \Delta S $.
Since there is no arbitrage ( what a fantasy ),
 $$d \Pi = \Pi r dt $$
Expand this:
$$ dV - \Delta dS = (V - \Delta S) r dt $$
Collect the terms and make some replacement:

$$ \frac{\partial V}{\partial t} + \frac12 \sigma^2 S^2 \frac{\partial^2 V }{\partial S^2} + (r ) S \frac{\partial V}{\partial S} - rV =  0 $$

Yeah, that's it.