[ quantlib-Bugs-490527 ] Crash on impliedVolatility call.

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

[ quantlib-Bugs-490527 ] Crash on impliedVolatility call.

SourceForge.net
Bugs item #490527, was opened at 2001-12-07 22:16
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=112740&aid=490527&group_id=12740

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Liam Herron (leedog)
Assigned to: Nobody/Anonymous (nobody)
Summary: Crash on impliedVolatility call.

Initial Comment:
In Python:

Python 2.1 (#2, Jun 22 2001, 10:20:42)
[GCC 2.7.2.3] on linux2
Type "copyright", "credits" or "license" for more
information.
>>> import QuantLib
>>> opt = QuantLib.EuropeanOption('Call', 44.0, 17.5,
0.0, 0.022, 0.041095890411, 0.89)
>>> opt.value()
26.515814767589454
>>> x = opt.impliedVolatility(28.7, 1e-4, 50)
[liam@optrader RiskManagementSystem]#

It seg faults at this point as well as
x = opt.impliedVolatility(26, 1e-4, 50)

But it seems to work for:
x = opt.impliedVolatility(opt.value(), 1e-4, 50)
0.89000002

This is a listed ADI 17.5 Dec Call that I am trying to
price.

Any ideas?


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

>Comment By: Ferdinando Ametrano (nando)
Date: 2001-12-19 08:43

Message:
Logged In: YES
user_id=34616

Hi Liam

thank you for your report.
I'm sorry for being so late in replying, but because of wrong settings I had no notification of your bug report.

1) a 400% (4.0) volatility would give a 27.87 option value, so to achieve a value of 28.7 one should use a volatility
greater than 400%: this is currently forbidden in QuantLib. Such a limit might be a bad choice: I will look into it

2) an European call with no dividend has the same value of the equivalent American option, that is its value has to
be greater of the intrinsic value (44.0-17.5=26.5). So there is no volatility that will give that option a value of 26.

This said I had no crash on my machine (Win32 NT, python 2.1, QuantLib 0.3.0a3), just exceptions:
>>> x= opt.impliedVolatility(26, 1e-4, 50)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
Exception: root not bracketed: f[0.0001000000,4.0000000000] ->
[0.51581476758945399000,1.87072669689047540000]
>>> x = opt.impliedVolatility(28.7, 1e-4, 50)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
Exception: root not bracketed: f[0.0001000000,4.0000000000] ->
[-2.18418523241054530000,-0.82927330310952385000]

I agree these messages are not easy to understand, but they just say that those 2 option values are not possible
in the [0.01%,400.0%] volatility range.

The real problem here if the segmentation fault you write about: to investigate this I need to know your Linux
distribution, configuration, QuantLib version, etc

ciao -- Nando

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

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