So I'm trying to solve the black scholes equation using a finite difference model, but I'm getting a answer that's off and I'm having trouble understanding why.
This is the result for a option with K = 100.0, r = 0.12, and sigma = 0.10
The left side is higher than it should be, and should start flat, but the right side is fairly close. This is the equation I'm solving:
$$ - \frac{\partial}{\partial t} V(t,s) + r\ s\ \frac{\partial}{\partial s} V(t,s) + \frac{1}{2}\ \sigma^2\ s^2\ \frac{\partial^2}{\partial s^2} V(t,s) - r\ V(t,s) = 0 $$
Here is a graph comparing the solution to a graph of values from the discretized formula, blue line is the correct values, and the yellow line is what I'm getting. This is at expiration with t=1
def euro_call_sym(S, K, T, r, sigma):
N = Normal('x', 0.0, 1.0)
d1 = (sympy.ln(S / K) + (r + 0.5 * sigma ** 2) * T) / (sigma * sympy.sqrt(T))
d2 = (sympy.ln(S / K) + (r - 0.5 * sigma ** 2) * T) / (sigma * sympy.sqrt(T))
call = (S * cdf(N)(d1) - K * sympy.exp(-r * T) * cdf(N)(d2))
return call
To generate my result I'm not using any boundary conditions, with one sided left derivatives on one point on the right edge and centered derivatives on the rest.
Does anyone know what boundary conditions would fix the behavior on the left side of the graph?