Escolar Documentos
Profissional Documentos
Cultura Documentos
3. Partial Derivatives
1 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
2 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
3 / 68
y = f (x1 , x2 , . . . , xn )
xj R for j = 1, . . . , n
S
K
T
t
asset price
strike price
maturity
time
r
q
asset volatility
risk-free interest rate
asset continuous dividend rate
C (S, t; ) =
S e q(T t) d+ (S, t; ) K e r (T t) d (S, t; )
log
d+ (S, t; ) =
Kjell Konis (Copyright 2013)
S
K
+ r q + 2 (T t)
, d (S, t; ) = d+ (S, t; ) T t
4 / 68
T 3. tPartial Derivatives
Partial Derivatives
Let f : Rn R
The partial derivative of f with respect to xj is denoted by
f
xj (x1 , . . . , nn ) and is defined as
f
f (x1 , . . . , xj1 , xj + h, xj+1 , . . . , xn ) f (x1 , . . . , xn )
() = lim
h0
xj
h
if the limit exists and is finite.
In practice, to compute
f
xj
fix xk for k 6= j
differentiate f as a function of one variable xj
Kjell Konis (Copyright 2013)
3. Partial Derivatives
5 / 68
Example
f (x , y ) = x 2 y + e xy
f (x , y ) =
x
2
xy 3
yx +
e
x
x
= y
u
2
x +
e
x
x
= 2xy + e u
u
= y 3
x
u
x
= 2xy y 3 e xy
let u = xy 3
3. Partial Derivatives
6 / 68
Example (continued)
f (x , y ) = x 2 y + e xy
f (x , y ) =
y
2
xy 3
yx +
e
y
y
= x2
u
y +
e
y
y
= x 2 + eu
u
y
= x 2 3xy 2 e xy
let u = xy 3
u
= 3xy 2
y
3
3. Partial Derivatives
7 / 68
The Gradient
D f (x ) =
f
x1
f
x2
3. Partial Derivatives
f
xn
8 / 68
f1 (x1 , . . . , xn )
f2 (x1 , . . . , xn )
f (x1 , . . . , xn ) =
..
fm (x1 , . . . , xn )
3. Partial Derivatives
9 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
10 / 68
xy
xy
e
=
ye
= y e xy = y 2 e xy
x x
x
x
2 xy
e
y 2
xy
xy
e
=
xe
= x e xy = x 2 e xy
y y
y
y
xy
xy
e
=
xe
= e xy + x e xy = e xy + xy e xy
x y
x
x
3. Partial Derivatives
11 / 68
2 xy
e = e xy + xy e xy
x y
xy
xy
e
=
ye
= e xy + y e xy = e xy + xy e xy
y x
y
y
2
2
and
?
x y
y x
For f (x , y ) = e xy have
2f
2 xy
2 xy
2f
=
e = e xy + xy e xy =
e =
x y
x y
y x
y x
But, f (x , y ) = e xy has a certain symmetry wrt differentiation
Lets see what happens when f (x , y ) = x 2 y + e xy
Kjell Konis (Copyright 2013)
3. Partial Derivatives
12 / 68
2
3
x y + e xy
x y
u
x2 +
e
x
y
x 2 + eu
x
y
i
h 2
3
x 3xy 2 e xy
x
= 2x 3y 2 e xy + 3xy 2
let u = xy 3
u
= 3xy 2
y
u
e
x
u
x
= 2x 3y 2 e xy 3xy 2 e u
= 2x 3y 2 e xy + 3xy 5 e xy
Kjell Konis (Copyright 2013)
3. Partial Derivatives
u
= y 3
x
13 / 68
2
3
x y + e xy
y x
u
2xy +
e
y
x
u
2xy + e u
y
x
=
=
i
h
2xy y 3 e u
y
2 xy 3
= 2x 3y e
u
= y 3
x
u
+y
e
y
3
= 2x 3y 2 e xy y 3 e u
u
y
= 2x 3y 2 e xy + 3xy 5 e xy
Kjell Konis (Copyright 2013)
let u = xy 3
3. Partial Derivatives
u
= 3xy 2
y
3
14 / 68
When f (x , y ) = x 2 y + e xy have
2f
2f
3
3
= 2x 3y 2 e xy + 3xy 5 e xy =
x y
y x
3. Partial Derivatives
15 / 68
The Hessian
Let f (x ) = f (x1 , . . . , xn ) : Rn R. The Hessian of f (x ) is denoted
by D 2 f (x ) and is defined to be the following n n array of (mixed)
partial derivatives.
2f
x12
2f
x x
1 2
2
D f (x ) =
..
2f
x1 xn
Kjell Konis (Copyright 2013)
2f
x2 x1
2f
x22
..
.
..
2f
x2 xn
3. Partial Derivatives
2f
xn x1
2f
xn xn
..
xn2
16 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
17 / 68
f (x + h, y ) f (x , y )
h0
h
f
(x , y ) =
y
f (x , y + h) f (x , y )
h0
h
lim
lim
The gradient of f (x , y ) is
f
D f (x , y ) =
(x , y )
x
3. Partial Derivatives
f
(x , y )
y
18 / 68
The Hessian of f (x , y ) is
2f
(x , y )
2x
D 2 f (x , y ) =
2f
(x , y )
x y
3. Partial Derivatives
2f
(x , y )
y x
2f
(x , y )
2y
19 / 68
Example
Let f (x , y ) = x 2 y 3 . Evaluate D f and D 2 f at the point (1, 2)
f
(x , y ) = 2xy 3
x
f
(x , y ) = 3x 2 y 2
y
2f
(x , y ) =
x 2
2f
(x , y ) =
x y
2f
(x , y ) =
y 2
Kjell Konis (Copyright 2013)
f
(x , y ) =
2xy 3 = 2y 3
x x
x
f
2 2
2f
(x , y ) =
3x y = 6xy 2 =
(x , y )
x y
x
y x
2 2
f
(x , y ) =
3x y = 6x 2 y
y y
y
3. Partial Derivatives
20 / 68
Example (continued)
D f (x , y ) =
D f (1, 2) =
f
(x , y )
x
2f
x 2
D f (x , y ) =
D f (1, 2) =
Kjell Konis (Copyright 2013)
2 1 23
f
(x , y ) = 2xy 3
y
"
2f
x y
3x 2 y 2
3 12 22 = 16 12
2f
y x
2f
y 2
"
2y 3 6xy 2
6xy 2 6x 2 y
2 23
6 1 22
2
6 1 2 6 12 2
3. Partial Derivatives
"
16 24
24 12
21 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
22 / 68
d
log(cos(t))
dt
3. Partial Derivatives
23 / 68
3. Partial Derivatives
24 / 68
Example
Let f (x , y ) = x 2 + y + xy 3 , x = e 2t , and y = t 2
First, by direct computation
f (t) = e 4t + t 2 + t 6 e 2t
d
f (t) = 4e 4t + 2t + 6t 5 e 2t + t 6 2e 2t
dt
df
dt
= 2t 6 e 2t + 6t 5 e 2t + 2t + 4e 4t
3. Partial Derivatives
25 / 68
Example (continued)
Again, using the chain rule
f (x , y ) = x 2 + y + xy 3
f
x
= 2x + y 3
f
= 1 + 3xy 2
y
dx
dt
= 2e 2t
dy
= 2t
dt
d
f (x , y ) =
dt
f dx
f dy
+
= (2x + y 3 ) 2e 2t + (1 + 3xy 2 ) 2t
x dt
y dt
= (2e 2t + t 6 ) 2e 2t + (1 + 3t 4 e 2t ) 2t
= 2t 6 e 2t + 6t 5 e 2t + 2t + 4e 4t
Kjell Konis (Copyright 2013)
3. Partial Derivatives
26 / 68
f
t
f x
f y
+
x s
y s
f h
f g
+
x s
y s
f x
f y
+
x t
y t
f g
f h
+
x t
y t
3. Partial Derivatives
27 / 68
3. Partial Derivatives
28 / 68
Example
f (x1 , x2 , x3 ) = x12 + x1 x2 + x1 x3 + 2x32
x1 (t1 , t2 ) = t12 t22 + 1, x2 (t1 , t2 ) = t22 + t1 + 1, x3 (t1 , t2 ) = t12 1
Compute
f
t1
f
t1
f x1
f x2
f x3
+
+
x1 t1
x2 t1
x3 t1
3. Partial Derivatives
29 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
30 / 68
Implicit Functions
So far, functions have expressed one variable in terms of another (or
others), e.g.,
y = f (x ) =
1 x2
or
y=
sin(x )
x
or
x 3 + y 3 = 6xy
3. Partial Derivatives
31 / 68
Implicit Functions
Circle
Folium
x2 + y2 = 1
x 3 + y 3 = 6xy
1 x2
red curve: y = 1 x 2
blue curve: y =
3. Partial Derivatives
32 / 68
Circle
Slope of tangent line to the unit circle
Case 1: blue curve y 0
d
y
dx
d p
1 x2
dx
dy
dx
1
d
(1 x 2 ) 2
dx
1
1
(1 x 2 ) 2 (2x )
2
d
y
dx
i
d h p
1 x2
dx
dy
dx
i
1
d h
(1 x 2 ) 2
dx
x
1 x2
1
1
= (1 x 2 ) 2 (2x )
2
3. Partial Derivatives
1 x2
33 / 68
2y
d
1
dx
d 2
d 2
x +
y = 0
dx
dx
2x + 2y
dy
dx
= 0
3. Partial Derivatives
dy
dx
= 2x
dy
dx
x
y
x
1 x2
(y 0)
1 x2
(y < 0)
34 / 68
Example
Compute
dy
dx
x 3 + y 3 = 6xy
d 3
x + y3 =
dx
d
6xy
dx
d 3
d
d 3
= 6y + 6x
x +
y
y
dx
dx
dx
3x 2 + 3y 2
dy
dx
= 6y + 6x
(3y 2 6x )
dy
dx
= 6y 3x 2
dy
dx
dy
dx
2y x 2
y 2 2x
3. Partial Derivatives
35 / 68
Example (continued)
dy
2y x 2
= 2
dx
y 2x
3. Partial Derivatives
36 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
37 / 68
The Greeks
Let V be the value of a portfolio of derivative securities based on one
underlying asset
The rates of change of the value V wrt pricing parameters (e.g., asset
price, volatility, etc.) useful for hedging
These rates of change are called the Greeks of the portfolio
Consider a portfolio containing a single European call option
Price using Black-Scholes
Inputs:
S
K
T
t
asset price
strike price
maturity
time
r
q
asset volatility
(continuous) risk-free interest rate
(continuous) asset dividend rate
3. Partial Derivatives
38 / 68
The Greeks
Black-Scholes formula for a European call option:
C (S, t) = Se q(T t) (d+ ) Ke r (T t) (d )
where
(z) =
2
log
d+ =
Z z
x2
e 2 dx
S
K
d = d+ T t =
+ r q + 2
T t
log
(T t)
3. Partial Derivatives
S
K
+ r q 2
T t
(T t)
39 / 68
Put-Call Parity
C (t) and P(t) prices of European call and put options on same asset
Same maturity T and strike price K
Put-Call parity states that
P(t) + S(t)e q(T t) C (t) = Ke r (T t)
3. Partial Derivatives
40 / 68
The Greeks
C
S
2C
=
S
S 2
C
t
C
r
vega =
3. Partial Derivatives
41 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
42 / 68
Delta
The Delta () of a European call option is the rate of change of
C (S, t) wrt the asset price S
C (S, t)
S
i
h q(T t)
Se
(d+ ) Ke r (T t) (d )
S
e q(T t)
S(d+ ) Ke r (T t)
(d )
S
S
q(T t)
(d+ ) Ke r (T t)
(d )
(d+ ) + S
S
S
3. Partial Derivatives
43 / 68
Delta (continued)
Consider the partial derivatives
(d )
S
The chain rule says
d
(d ) =
(d )
S
d
S
Recall definition of
Z d
(d ) =
(d ) =
d
Z d
(x ) dx =
x2
1
e 2 dx
2
Z d
(x ) dx =
d
Z d
x2
1
e 2 dx
2
(d )2
1
(d ) = (d ) = e 2
d
2
Kjell Konis (Copyright 2013)
3. Partial Derivatives
44 / 68
Delta (continued)
Results so far
(d+ ) Ke r (T t)
=e
(d+ ) + S
(d )
S
S
d
(d ) =
(d )
S
d
S
q(T t)
(d )2
1
(d ) = (d ) = e 2
d
2
Substituting
d
d+
Ke r (T t) (d )
S
S
3. Partial Derivatives
45 / 68
Delta (continued)
Finally, need to compute partial derivatives of d+ and d wrt to S
log
d =
d =
S
=
+ r q 2
T t
S
1
log
S
K
T t
d =
S
Let u =
S
K
S
K,
(T t)
r q 2 (T t)
+
S
T t
1
1 u
1
K 1
1
=
log(u) =
T t u S
T t S K
T t S
S T t
3. Partial Derivatives
46 / 68
Delta (continued)
Putting it all together . . .
d =
S
d
d+
Ke r (T t) (d )
S
S
S T t
= e q(T t) (d+ ) +
e q(T t) (d+ ) Ke r (T t) (d )
T t
S T t
3. Partial Derivatives
47 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
48 / 68
Gamma ()
Gamma () is the rate of change of Delta ()
Hence: Gamma () is the second partial derivative of C wrt S
=
C
2C
=
=
S
S S
S 2
e q(T t) (d+ ) Ke r (T t) (d )
=
=
e q(T t) (d+ ) +
S
S
T t
S T t
3. Partial Derivatives
49 / 68
e q(T t) (d+ ) Ke r (T t) (d )
T t
S T t
=0
T t
S T t
Strategy: manipulate (d ) into (d+ ) and see what falls out
d2
1
(d ) = exp
2
2
Kjell Konis (Copyright 2013)
2 !
d+ T t
1
= exp
2
2
3. Partial Derivatives
50 / 68
2 !
d+ T t
1
exp
2
2
!
2 2d T t + 2 (T t)
d+
1
+
exp
2
2
d2
1
exp +
2
2
!
!
2d+ T t
2 (T t)
exp
exp
2
2
log
Reminder: d+ =
"
S
K
S
= (d+ ) exp log
K
Kjell Konis (Copyright 2013)
+ r q + 2
T t
(T t)
2
+ r q+
2
3. Partial Derivatives
2 (T t)
(T t) exp
2
#
"
51 / 68
"
2
r q+
2
2
(T t) (T t)
2
S r (T t) q(T t)
e
e
K
Substituting
e q(T t) (d+ ) Ke r (T t) (d )
T t
S T t
=
T t
S T t
=0
T t
T t
3. Partial Derivatives
52 / 68
Gamma ()
=
=
S
=
"
e q(T t) (d+ ) Ke r (T t) (d )
e q(T t) (d+ ) +
S
T t
S T t
i
h q(T t)
e
(d+ )
S
= e q(T t)
(d+ )
S
= e q(T t)
d+
(d+ )
d+
S
d
1
=
S
S T t
e q(T t)
(d+ )
S T t
2
d+
e q(T t)
1
e 2
=
S
S T t 2
3. Partial Derivatives
53 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
54 / 68
Rho ()
Rho () is the rate of change of the value of the portfolio wrt the
risk-free interest rate r
Black-Scholes formula
C (S, t) = Se q(T t) (d+ ) Ke r (T t) (d )
Derivative wrt r :
=
i
h q(T t)
Se
(d+ ) Ke r (T t) (d )
r
Product rule:
= Se q(T t)
(d+ )
r
K (T t)e
Kjell Konis (Copyright 2013)
r (T t)
(d ) + Ke
3. Partial Derivatives
r (T t)
(d )
r
55 / 68
Rho ()
Chain rule:
= Se q(T t) (d+ )
d+
r
K (T t)e r (T t) (d ) + Ke r (T t) (d )
d
r
d =
r
S
K
+ r q 2
T t
(T t)
r T t
=
+C
T t
3. Partial Derivatives
56 / 68
Rho ()
Substituting
r d
T t
...
= K (T t)e r (T t) (d )
T t
T t
q(T t)
r (T t)
+ Se
(d+ )
+ Ke
(d )
Rewrite as . . .
= K (T t)e r (T t) (d )
"
e q(T t) (d+ ) Ke r (T t) (d )
+ S(T t)
+
T t
S T t
= K (T t)e r (T t) (d )
Kjell Konis (Copyright 2013)
3. Partial Derivatives
57 / 68
Vega
Vega is the rate of change of the value of the portfolio wrt the
volatility
Black-Scholes formula
C (S, t) = Se q(T t) (d+ ) Ke r (T t) (d )
Derivative wrt :
vega =
i
h q(T t)
Se
(d+ ) Ke r (T t) (d )
Chain rule:
vega = Se q(T t) (d+ )
Kjell Konis (Copyright 2013)
d+
d
Ke r (T t) (d )
3. Partial Derivatives
58 / 68
Vega
Partial derivatives of d+ and d wrt :
+ r q 2
T t
log
+ (r q)(T t)
(T t)
T t
2 T t
S
K
d =
=
d
S
K
log
log
log
log
=
Kjell Konis (Copyright 2013)
S
K
S
K
S
K
(T t)
+ (r q)(T t)
(T t)
2
T t
2 T t
2
+ (r q)(T t)
(T t)
2
2
2
T t
T t
2
+ (r q 2 )(T t)
2 T t
3. Partial Derivatives
59 / 68
Bag of Tricks
Substitute
log
d =
S
K
+ (r q 2 )(T t)
2 T t
into
vega = Se q(T t) (d+ )
d+
d
Ke r (T t) (d )
=0
T t
S T t
Rewrite as
Se q(T t) (d+ ) = Ke r (T t) (d )
Kjell Konis (Copyright 2013)
3. Partial Derivatives
60 / 68
Vega
The expression for vega becomes
d
d+
Ke r (T t) (d )
vega = Se q(T t) (d+ )
d+ d
= Se q(T t) (d+ )
= Se q(T t) (d+ )
(d+ d )
Recall: d = d+ T t so that
d+ d = d+ (d+ T t)
T t
=
T t
(d+ d ) =
3. Partial Derivatives
61 / 68
Vega
Substuting . . .
vega = Se q(T t) (d+ )
vega = S
(d+ d )
T t e q(T t) (d+ )
3. Partial Derivatives
62 / 68
Outline
1
Implicit Functions
Delta
Gamma ()
10
Theta ()
Kjell Konis (Copyright 2013)
3. Partial Derivatives
63 / 68
Theta ()
Theta is the rate of change of the value of the portfolio wrt the time t
Black-Scholes formula
C (S, t) = Se q(T t) (d+ ) Ke r (T t) (d )
Derivative wrt t:
=
i
h q(T t)
Se
(d+ ) Ke r (T t) (d )
t
(d+ )
t
rKe r (T t) (d ) + Ke r (T t)
Kjell Konis (Copyright 2013)
3. Partial Derivatives
(d )
t
64 / 68
Theta ()
= qSe q(T t) (d+ ) rKe r (T t) (d )
+ Se q(T t)
(d+ ) Ke r (T t) (d )
t
t
+ Se q(T t) (d+ )
d+
d
Ke r (T t) (d )
t
t
d+ d
t
t
3. Partial Derivatives
65 / 68
Theta ()
Again, rewrite the quantity
d+ d
t
t
(d+ d )
t
T t
t
2 T t
(T t) 2
t
Substitute into . . .
= qSe q(T t) (d+ ) rKe r (T t) (d )
+ Se q(T t) (d+ )
Kjell Konis (Copyright 2013)
d+ d
t
t
3. Partial Derivatives
66 / 68
Theta ()
Finally . . .
Se q(T t)
3. Partial Derivatives
67 / 68
http://computational-finance.uw.edu
3. Partial Derivatives
68 / 68