MATLAB: What is the difference between IMPVBYBLS and BLSIMPV, and how to I determine the Black-Scholes implied volatility using these functions

black-scholesFinancial Instruments ToolboxFinancial Toolboxvolatility

What is the difference between the function IMPVBYBLS from Financial Instruments Toolbox, and BLSIMPV from Financial Toolbox? And how do I use them such that they yield the same result for the Black-Scholes implied volatility?

Best Answer

Both IMPVBYBLS and BLSIMPV use the Black-Scholes model to compute the implied volatility for a given option price. However, one of the main differences between the two functions is that IMPVBYBLS allows specifying cash dividends as well as continuous dividend yields, while BLSIMPV only allows continuous dividend yields.
If you specify continuous dividend yields for both IMPVBYBLS and BLSIMPV, they produce the same results:
Strike = 29;
AssetPrice = 30;
Sigma = .25;
Rates = 0.05;
Settle = datenum('01-Jan-2008');
Maturity = datenum('01-May-2008');
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, ...
'EndDates',Maturity, 'Rates', Rates, 'Compounding', -1,'Basis',1);
DividendType = {'continuous';'continuous'};
DividendAmounts = [0.05; 0.045];
ExDividendDates = {NaN;NaN};
StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts);
OptSpec = {'call'; 'put'};
OptionPrice = optstockbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike);
ImpvVol1 = impvbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, ...
Strike, OptionPrice)
ImpvVol2 = blsimpv(AssetPrice, Strike, Rates, ...
yearfrac(Settle,Maturity,1), OptionPrice, 'Class', OptSpec,'Yield',DividendAmounts)
ImpvVol1 =
0.250000000000000
0.250000000000000
ImpvVol2 =
0.250000000000000
0.250000000000000