def calculate_vega(forward, strike, implied_sigma, annuity, days_to_maturity):
""" This function returns Vega, which is the same for both payer/receiver
:param forward:
:param strike:
:param implied_sigma:
:param annuity:
:param days_to_maturity:
:return:
"""
from scipy.stats import norm
from math import sqrt
d1 = calculate_d1(forward, strike, implied_sigma, days_to_maturity)
year_fraction = float(days_to_maturity) / 365
vega = annuity * forward * sqrt(year_fraction) * norm.pdf(d1)
return vega
评论列表
文章目录