Debugging the Python Implied Volatility Code

3 years ago
24

I wanted to go back and address some comments about the implied volatility root-finding code occasionally crashing for in-the-money options. Figuring out the cause of this is easy so while we’ll find the reason for the error, I wanted to do more of a conceptual video on how one might go about debugging code for numeric calculations. This is one of those “easier said than done” since this is often as much an art as a science as I say in the video. However, just by thinking about the numbers we are entering and doing a couple of simple plots, we can zero in on the source of the problem rapidly in this case.

Github: https://github.com/kpmooney/numerical_methods_youtube/tree/master/root_finding/implied_volatility

Tip Jar: http://paypal.me/kpmooney

Loading comments...