Option Pricing, Numerical Methods, Monte Carlo, Monte Carlo Simulation.
difference grid option_type: "call" or "put" """ # Set up the finite difference grid dt = T/N dx = sigma * np.sqrt(dt) edx = np.exp(dx) edx2 = edx**2 pu = (r - 0.5*sigma**2) * dt / (2*dx) pm = 1 - dt*sigma**2/(dx**2) pd = -(r - 0.5*sigma**2) * dt / (2*dx) u = np.arange(M+1) u = X * edx**u u =