Comments (3)
Thanks for bringing up this issue @dgbustos ! I've gone back and forth when considering the API for the implied volatility functions. With the "approximate_vol" function providing a value close to the optimum value I have not ever had a panic. In the tests I randomly simulate parameters; with no panics.
Have you actually experienced a panic when using the implied volatility functions? If so, can you provide the parameters which resulted in the panic?
Thanks!
from black_scholes_rust.
I have 500 examples from a recent file of SPY option quotes. They're all for deep-in-the-money calls. For example
black_scholes::call_iv( 50.275, 274.525, 225.000, 0.0244, 0.156 );
black_scholes::call_iv( 62.02, 274.525, 222.000, 0.0244, 1.823 );
When I encountered this in another library, I think I tracked the reason down to negative time value, and https://math.stackexchange.com/a/2959355 might be informative.
from black_scholes_rust.
That makes a lot of sense. I'll update the code (hopefully this weekend) and bump the crates version.
from black_scholes_rust.
Related Issues (13)
- Remove approx from dependency and make it a dev-dependency
- call_iv NaN? HOT 1
- second + third order greeks
- How big of a deal is a ~1.5% mismatch on calculated IV? HOT 3
- compute_all isn't really realistic if it only accepts 1 sigma/IV because call/put IVs are usually different HOT 1
- put_vanna should be negative? HOT 1
- Maturity clarity HOT 7
- WASM support HOT 2
- Add support for dividend yield HOT 3
- Proposal: Calc all greeks once & Decimals HOT 4
- Add benches
- CDF function is not appropriate, can use statrs package for accurate values. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from black_scholes_rust.