Posted by
John Maiden on
Jun 28, 2007; 1:32pm
URL: http://quantlib.414.s1.nabble.com/Proposed-change-to-Convertible-Bond-model-tp9499p9502.html
Luigi-
In DiscreteConvertible there is a protected array called dividendValues_.
It's used once to compute the present value of the dividends, but is not used
again. The code below goes into the constructor for DiscreteConvertible:
//existing code
dividendValues_ = Array(arguments_.dividends.size(), 0.0);
boost::shared_ptr<GeneralizedBlackScholesProcess> process =
boost::dynamic_pointer_cast<GeneralizedBlackScholesProcess>(
arguments_.stochasticProcess);
QL_REQUIRE(process, "Black-Scholes process required");
Date settlementDate = process->riskFreeRate()->referenceDate();
for (Size i=0; i<arguments_.dividends.size(); i++) {
if (arguments_.dividends[i]->date() >= settlementDate) {
dividendValues_[i] =
arguments_.dividends[i]->amount() *
process->riskFreeRate()->discount(
arguments_.dividends[i]->date());
}
}
//load in a schedule of dirty dividend prices
for (Size i=0; i<arguments_.dividends.size(); i++) {
dirtyDividends_.push_back(
boost::shared_ptr<Dividend>(new FixedDividend(dividendValues_[i],
arguments_.dividends[i]->date())));
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev