implied blows up for binary option
Posted by Dirk Eddelbuettel on Feb 25, 2002; 7:26pm
URL: http://quantlib.414.s1.nabble.com/implied-blows-up-for-binary-option-tp10003.html
Playing with binaries, I noticed that implied Vol calculations abort:
edd@homebud:~/misc> cat binary_abrt.cc
#include <ql/quantlib.hpp>
int main(int argc, char* argv[])
{
using namespace QuantLib;
using QuantLib::Pricers::BinaryOption;
try {
double underlying = 102;
double strike = 100;
Spread dividendYield = 0.01;
Rate riskFreeRate = 0.05;
Time maturity = 1.0;
double volatility = 0.60;
BinaryOption BO = BinaryOption(Option::Call, underlying, strike,
dividendYield, riskFreeRate, maturity,
volatility);
cout << "value is " << BO.value() << endl;
double impliedVol = BO.impliedVolatility(1.1*BO.value());
cout << "implied is " << impliedVol << endl;
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
} catch (...) {
std::cout << "unknown error" << std::endl;
}
exit (0);
}
edd@homebud:~/misc> ./binary_abrt
value is 0.400098
root not bracketed: f[0.0001000000,4.0000000000] -> [0.20004910384016516556,0.20004910384016516556]
I don't understand why. Should somebody comment?
This is on Debian with the 0.3.0a5-20020120 packages.
Dirk
--
Good judgement comes from experience; experience comes from bad judgement.
-- Fred Brooks