Ok here is my process right now... admittedly relatively straightforward.
def calculate_implied_div(df):
for expiration in data.expiry.unique():
temp = data.copy()
temp = temp[temp.expiry == expiration]
temp['spread'] = np.abs(temp['mid_pricePut'] - temp['mid_priceCall'])
temp = temp[temp['spread'] == temp['spread'].min()]
implied_div = np.log((temp['strike']*np.exp(-1*temp['rCall']*temp['TCall']) + temp['mid_priceCall'] - temp['mid_pricePut'])
/ temp['underlyingPriceCall']) * (-1 * temp['TCall'])
data.loc[data.expiry == expiration, 'implied_div'] = implied_div.values.item()
calculate_implied_div(data)
plt.scatter(data.expiry.unique(), data.implied_div.unique())
The functional form of this implied dividend looks OK.
So I used the put and call that are priced closest to each other instead of closest to ATM.
expiry T implied_div r
2016-11-18 0.027397 -0.000044 0.002800
2016-12-16 0.104110 -0.000638 0.002990
2017-01-20 0.200000 0.000632 0.003851
2017-02-17 0.276712 0.000969 0.004439
2017-03-17 0.353425 0.002106 0.004838
2017-06-16 0.602740 0.006221 0.005908
2017-09-15 0.852055 0.013059 0.006656
2017-12-15 1.101370 0.022901 0.007262
2018-01-19 1.197260 0.026608 0.007416
2018-03-16 1.350685 0.034302 0.007661
2018-06-15 1.600000 0.048671 0.008060
2018-09-21 1.868493 0.067275 0.008490
2018-12-21 2.117808 0.088688 0.008900
My question though is if a practitioner is pricing an implied dividend, is this how they do it? Do they not use option prices because of liquidity issues or uncertainty in the dividend, or... some other issue? If I have a model that requires a dividend adjustment, should I just use the current annualized dividend yield?