Posted by
Grant Birchmeier on
URL: http://quantlib.414.s1.nabble.com/impliedVolatility-always-throws-exception-instead-of-0-or-1-tp7284.html
What is the proper idiom for using VanillaOption::impliedVolatility
when the resulting volatility will approach 0 or 1?
I have a large set of options that I'm running this on; some of them
are at parity, which implies volatility=0. But the function never
returns 0; instead it always returns the cryptic and useless "root not
bracketed" exception.
(I'm not entirely sure what this exception's message means.
"f[1e-007,4] -> [1.482733e-003,9.330532e-001]"... what? Both values
on the right are between 1e-7 and 4, which are the default min and
max, so I don't know what the deal is.)
Sure, I could catch that exception, but I won't easily know if
volatility should be 0 or 1.
How would a seasoned QuantLib coder do this?
Extra info about my situation:
1) I'm using the C# SWIG release (probably not important)
2) I'm using the two-arg form of VanillaOption::impliedVolatility(),
where the remaining arguments are set to defaults.
3) data values:
double underly = 3.505;
double strike = 2;
double rate = .00445;
double value = 1.505;
QuantLib.Date todaysDate = new QuantLib.Date(1,
QuantLib.Month.March, 2009);
QuantLib.Date maturityDate = new QuantLib.Date(1,
QuantLib.Month.May, 2009);
Can provide more info if necessary.
Thanks
-Grant
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
http://p.sf.net/sfu/www-adobe-com_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users