Matlab代写-2V

Convert BS PDE to Heat Equation
Black–Scholes PDE:
∂V
∂t
+
1
2
∂2V
∂S2
σ2S2 + (r − δ)S ∂V
∂S
− rV = 0
with final condition V (S,T ) = f (T ).
Change of variables to get constant coefficients first:
S = exp(x), t = T − 2τ
σ2
,
V (S, t) = v(x , τ) = v
(
ln(S),
σ2
2
(T − t)
)
The partial derivatives of V with respect to S and t expressed in terms of
those of v in terms of x and τ :
∂V
∂t
= −σ
2
2
∂v
∂τ
∂V
∂S
=
1
S
∂v
∂x
∂2V
∂S2
= − 1
S2
∂v
∂x
+
1
S2
∂2v
∂x2
38 / 41
Convert Black–Scholes PDE to Heat Equation (cont.)
Placing these expressions into the Black-Scholes partial differential
equation and simplifying we have
∂v
∂τ
=
∂2v
∂x2
+
(
2r − 2δ
σ2
− 1
)
∂v
∂x
− 2r
σ2
v .
Setting κ = 2r/σ2, λ = 2δ/σ2, the Black–Scholes final value problem
becomes:
∂v
∂τ
=
∂2v
∂x2
+ (κ− λ− 1) ∂v
∂x
− κv , −∞ < x <∞,
0 ≤ τ ≤ σ
2
2
T
v(x ,0) = V (ex ,T ) = f (ex ), −∞ < x <∞
One more change of variables is needed in order to eliminate the last
two terms on the right-hand side of the last equation:
v(x , τ) = eαx+βτu(x , τ) = ψu,
39 / 41
Convert Black–Scholes PDE to Heat Equation (cont.)
Namely
v(x , τ) = eαx+βτu(x , τ) = ψu,
Computing the partial derivatives of v in terms of x and τ we have
∂v
∂τ
= βψu + ψ
∂u
∂τ
∂v
∂x
= αψu + ψ
∂u
∂x
∂2v
∂x2
= α2ψu + 2αψ
∂u
∂x
+ ψ
∂2u
∂x2
40 / 41
Convert Black–Scholes PDE to Heat Equation (cont.)
Placing those expressions into the partial differential equation which v
satisfies, and setting
α = −1
2
(κ− λ− 1) = σ
2 − 2r + 2δ
2σ2
,
β = −1
4
(κ− λ+ 1)2 − λ = −
(
σ2 + 2r − 2δ
2σ2
)2
− 2δ
σ2
.
We have
∂u
∂τ
=
∂2u
∂x2
, −∞ < x <∞,0 ≤ τ ≤ σ
2
2
T
u(x ,0) = e−αxv(x ,0) = e−αx f (ex ), −∞ < x <∞
If the option is a call option, with strike price K , then
f (x) = max(x − K ; 0), and
u(x ,0) = e−αx max(ex − K ,0).
41 / 41