unexpected result from function "blsimpv"
6 views (last 30 days)
Show older comments
Hi:
I use command to calculate option IV but returns nan, this particularly happen while the strike price is ITM (in the money), I read through the documentation and I believe I'm using the correct inputs. so maybe this is a bug?
blsimpv(455,385, 0.1, 7.420091324200912e-04,67,'Class',{'Call'}, 'Limit',100)*100
Thanks!
Yu
0 Comments
Answers (1)
Aabha
on 9 Jun 2025
I understand that you are using the ‘blsimpv’ function in MATLAB to compute the implied volatility of an option, but you're getting a result of ‘NaN’. This usually happens when the inputs to the function are inconsistent or violate assumptions in the Black-Scholes model, making it impossible for the function to converge to a volatility value.
For a European call option, the intrinsic value is calculated as:
value = max(currentStockPrice - strikePrice, 0);
In this case, the minimum value of the ‘Value’ parameter should be (455 – 385) = 70, from the specified values of prices. Since the specified value parameter is less than 70 in this case, it violates the assumptions in the Black-Scholes model, leading to the ‘NaN’ result. The function provides the expected numerical result when the ‘Value’ parameter is changed as per the following:
blsimpv(455, 385, 0.1, 7.420091324200912e-04, 75, 'Class',{'Call'}, 'Limit',100) * 100
Please refer to the following documentation link for more information about the 'blsimpv' function:
I hope this helps.
0 Comments
See Also
Categories
Find more on Price and Analyze Financial Instruments in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!