Hi,
FdDividendAmericanOption::value() fails, and here is the error message: QuantLib::Error::Error: A value must be supplied for this type of boundary condition at:../../ql/FiniteDifferences/boundarycondition.hpp:56, if the dividendTime is zero. Could someone please suggest a simple work around? Note that it wouldn't suffice to simply remove the dividend and adjust the price by its amount since the the option might need to be exercised that day. For example I can add some small number to the time, but I am concerned that this will effectively push the dividend to the next time step. Is this a valid concern? Thanks, Vadim P.S> Here is how to reproduce the error #include <ql/quantlib.hpp> using namespace std; using namespace QuantLib; using namespace QuantLib::Pricers; int main() { const unsigned timeSteps = 20; const unsigned assetSteps = 20; vector<double> dividendA, dividendTimeA; dividendA.push_back(0.125); dividendTimeA.push_back(0); // this is the crux double under=40.25; double strike=35; double dividendYield=0; double interestRate=0.05; double expirationTime=0.1; double sigma=0.25; FdDividendAmericanOption opt(Option::Call, under, strike, dividendYield, interestRate, expirationTime, sigma, dividendA, dividendTimeA, timeSteps, assetSteps); double x = opt.value(); return 0; } -------------------------------------------------- DISCLAIMER This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Trading Group may, at its discretion, monitor and review the content of all e-mail communications. |
Hi Vadim,
note that the vector dividendTimeA should contain the ex-dividend dates. If the dividend will be paid today the ex-dividend date is tomorrow, hence cannot be 0.0(should be a positive small number). However, if the dividend was paid yesterday you do not need to include the computation of that dividend in the option your are evaluating today as long as your stock price include the cash payment of the dividend. IMHO, these kind of issues should be handled outside FdDividendAmericanOption. regards, Marco Marchioro. At 12:56 PM 9/10/02 -0500, Vadim Ogranovich wrote: >Hi, > >FdDividendAmericanOption::value() fails, and here is the error message: >QuantLib::Error::Error: A value must be supplied for this type of boundary >condition at:../../ql/FiniteDifferences/boundarycondition.hpp:56, >if the dividendTime is zero. > >Could someone please suggest a simple work around? Note that it wouldn't >suffice to simply remove the dividend and adjust the price by its amount >since the the option might need to be exercised that day. >For example I can add some small number to the time, but I am concerned that >this will effectively push the dividend to the next time step. Is this a >valid concern? > >Thanks, Vadim > >P.S> Here is how to reproduce the error > >#include <ql/quantlib.hpp> > >using namespace std; >using namespace QuantLib; >using namespace QuantLib::Pricers; > >int main() { > const unsigned timeSteps = 20; > const unsigned assetSteps = 20; > > vector<double> dividendA, dividendTimeA; > dividendA.push_back(0.125); > dividendTimeA.push_back(0); // this is the crux > > double under=40.25; > double strike=35; > double dividendYield=0; > double interestRate=0.05; > double expirationTime=0.1; > double sigma=0.25; > > > FdDividendAmericanOption opt(Option::Call, under, > strike, > dividendYield, interestRate, > expirationTime, sigma, > dividendA, dividendTimeA, > timeSteps, assetSteps); > > > double x = opt.value(); > > return 0; >} > >-------------------------------------------------- >DISCLAIMER >This e-mail, and any attachments thereto, is intended only for use by the >addressee(s) named herein and may contain legally privileged and/or >confidential information. If you are not the intended recipient of this >e-mail, you are hereby notified that any dissemination, distribution or >copying of this e-mail, and any attachments thereto, is strictly prohibited. >If you have received this e-mail in error, please immediately notify me and >permanently delete the original and any copy of any e-mail and any printout >thereof. > >E-mail transmission cannot be guaranteed to be secure or error-free. The >sender therefore does not accept liability for any errors or omissions in >the contents of this message which arise as a result of e-mail transmission. > >NOTICE REGARDING PRIVACY AND CONFIDENTIALITY > >Knight Trading Group may, at its discretion, monitor and review the content >of all e-mail communications. > > > >------------------------------------------------------- >This sf.net email is sponsored by: OSDN - Tired of that same old >cell phone? Get a new here for FREE! >https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 >_______________________________________________ >Quantlib-users mailing list >[hidden email] >https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |