[ quantlib-Bugs-507850 ] QuantlibPython IV func crashes python

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Bugs-507850 ] QuantlibPython IV func crashes python

SourceForge.net
Bugs item #507850, was opened at 2002-01-23 22:19
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=112740&aid=507850&group_id=12740

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: QuantlibPython IV func crashes python

Initial Comment:

When the impl vol call is made with a value less
than or equal to parity (which is often the case for
bids in the marketplace), The Quantlibc.so library
crashes which crashes my python process as well.

This should have some boundary checking and return
0 or -1 if it is outside the boundaries.




----------------------------------------------------------------------

>Comment By: Ferdinando Ametrano (nando)
Date: 2002-01-26 02:35

Message:
Logged In: YES
user_id=34616

Hi

> >>> opt.impliedVolatility(12, 1e-6, 100)
> Traceback (most recent call last):
>   File "<pyshell#16>", line 1, in ?
>     opt.impliedVolatility(12, 1e-6, 100)
> Exception: root not bracketed: f[0.000100,4.000000] -> [-
> 1.01915488254814870000,-0.72995742951797027000]
>
> I have no idea what the heck the "root not bracketed"
means
> though.
It means that the volatility range of 0.01%-400% could not
bracket the
requested value of 12 (the message is not clear: I agree)

as you can see up to 400% volatility the option value is
less than 12
>>> import QuantLib
>>> QuantLib.EuropeanOption('Put', 4.0, 15.0, 0.0, 0.0212,
0.06, 1.6).value()
10.981222948151906
>>> QuantLib.EuropeanOption('Put', 4.0, 15.0, 0.0, 0.0212,
0.06, 4.0).value()
11.267654249472969

> This should have some boundary checking and return
> 0 or -1 if it is outside the boundaries.
It throws a python exception instead

The crash under Red Hat 6.2 is the real problem here.
We have fixed few bugs that could have solved this problem.
Would you mind trying the last CVS snapshot (also
downloadable from http://www.quantlib.org/snapshot.html)
and report to us?

thank you very much

ciao - Nando

PS What about the QuantLib-Python test suite? Does it run
with no problems?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-01-25 21:33

Message:
Logged In: NO

I see it on RHat 6.2 but not on Win 98

RHat 6.2:
Python 2.1.1 (#1, Nov 14 2001, 20:43:53)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on
linux2
Type "copyright", "credits" or "license" for more
information.
>>> import QuantLib
>>> opt = QuantLib.EuropeanOption('Put', 4.0, 15,
0.0 ,0.0212, 0.0602739726027,
1.6)
>>> opt.impliedVolatility(12, 1e-6, 100)
Segmentation fault                  

Yet Win 98 has
>>> opt = QuantLib.EuropeanOption('Put', 4.0, 15,
0.0 ,0.0212, 0.0602739726027, 1.6)
>>> opt.impliedVolatility(12, 1e-6, 100)
Traceback (most recent call last):
  File "<pyshell#16>", line 1, in ?
    opt.impliedVolatility(12, 1e-6, 100)
Exception: root not bracketed: f[0.000100,4.000000] -> [-
1.01915488254814870000,-0.72995742951797027000]


I have no idea what the heck the "root not bracketed" means
though.

----------------------------------------------------------------------

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=112740&aid=507850&group_id=12740