BSM模型是最常用的期权定价模型之一，虽然其假设不合符市场事实，但是该模型的提出奠定了现代金融衍生品法则的基石。 该模型在学界的发展：

B-S模型认为期权的标的资产价格服从扩散模型，学者们不断对扩散模型进行改进并得到相应的期权定价模型，如跳扩散期权价格模型、随机波动率模型、非仿射随机波动率期权定价模型等，这些模型统称为基于参数扩散过程的期权定价模型。后有学者把扩散方程设定为非参数形式，建立了基于非参数扩散过程的期权定价模型。

# Black-Scholes-Merton (1973) European Call & Put Valuation from pylab import
plt plt.style.use('seaborn') %matplotlib inline import math import numpy as np
import matplotlib as mpl import matplotlib.pyplot as plt from scipy.integrate
import quad mpl.rcParams['font.family'] = 'serif' # # Helper Functions # def dN(
x): ''' Probability density function of standard normal random variable x. '''
#标准正态随机变量 x 的概率密度函数 return math.exp(-0.5 * x ** 2) / math.sqrt(2 * math.pi) def
N(d): ''' Cumulative density function of standard normal random variable x. '''
return quad(lambda x: dN(x), -20, d, limit=50)[0] def d1f(St, K, t, T, r, sigma)
:#设置函数d1 ''' Black-Scholes-Merton d1 function. Parameters see e.g.
BSM_call_value function. ''' d1 = (math.log(St / K) + (r + 0.5 * sigma ** 2)* (T
- t)) / (sigma * math.sqrt(T - t)) return d1 # # Valuation Functions # #欧式看涨期权函数
def BSM_call_value(St, K, t, T, r, sigma): ''' Calculates Black-Scholes-Merton
European call option value. Parameters ========== St : float stock/index level
at time t K : float strike price t : float valuation date T : float date of
maturity/time-to-maturity if t = 0; T > t r : float constant, risk-less short
rate sigma : float volatility Returns ======= call_value : float European call
present value at t ''' d1 = d1f(St, K, t, T, r, sigma) d2 = d1 - sigma * math.
sqrt(T - t) call_value = St * N(d1) - math.exp(-r * (T - t)) * K * N(d2) return
call_value#欧式看跌期权函数 def BSM_put_value(St, K, t, T, r, sigma): ''' Calculates
Black-Scholes-Merton European put option value. Parameters ========== St :
float stock/index level at time t K : float strike price t : float valuation
date T : float date of maturity/time-to-maturity if t = 0; T > t r : float
constant, risk-less short rate sigma : float volatility Returns =======
put_value : float European put present value at t ''' put_value = BSM_call_value
(St, K, t, T, r, sigma) \ - St + math.exp(-r * (T - t)) * K return put_value #

option maturity r = 0.05 # constant short rate sigma = 0.2 # constant
volatility of diffusion t=0 print('BSM模型求解的看涨期权价格为：',BSM_call_value(St, K, t, T,
r, sigma)) print('BSM模型求解的看跌期权价格为：',BSM_put_value(St, K, t, T, r, sigma))

BSM模型求解的看涨期权价格为： 10.45058357218553
BSM模型求解的看跌期权价格为： 5.573526022256942

Su=St-D*np.exp(-((t)*r)) Su

# 赋值 St = 100.00 # initial index level K = 100.00 # strike level T = 1. # call
option maturity r = 0.05 # constant short rate sigma=0.2 # constant volatility
of diffusion t=20/360 D=2 print('BSM模型求解的看涨期权价格为：',BSM_call_value(St, K, t, T, r
, sigma)) print('BSM模型求解的看跌期权价格为：',BSM_put_value(St, K, t, T, r, sigma))

BSM模型求解的看涨期权价格为： 10.090922223626734
BSM模型求解的看跌期权价格为： 5.478462396092041

# C(K) plot现值与执行价的关系 plt.subplot(221) klist = np.linspace(80, 120, points)
vlist= [function(Su, K, t, T, r, sigma) for K in klist] plt.plot(klist, vlist)
plt.grid(True) plt.xlabel('strike \$K\$') plt.ylabel('present value')

GitHub

Gitee