From: Hong Y. <hy...@ho...> - 2011-06-28 11:14:30
|
Hi. I have read Hull’s “Options ...” book too, particularly the parts on H-W trinomial-tree building procedure. Compared to the code, it seems that ‘value’ in each i-loop corresponding to the displacement function alpha(), ‘statePrices’ corresponding to Q(), ‘underlying()’ are initial interest-rate and interest-rate related computing parameters. Do you intend to use H-W on real financial data? Also, I have got H-W’s paper on numerical procedure (I) and 2001 version of F Mercurio’s book. If you would be interested, I am happy to share a copy of the references. Regards, Hong Yu From: Smith, Dale Sent: Monday, June 27, 2011 8:41 PM To: Hong Yu Cc: qua...@li... Subject: RE: [Quantlib-users] Understanding HullWhite::tree method Hi, I don’t have Hull’s paper, nor do I have Hull’s “Interest Rate Derivatives”. I’ll take a look at Chapter 30 before I respond further. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Office: 678-375-5315 Mobile: 678-982-6599 Mail: dal...@fi... www.fiserv.com From: Hong Yu [mailto:hy...@ho...] Sent: Monday, June 27, 2011 8:07 AM To: Smith, Dale Cc: qua...@li...; Yu Hong Subject: Re: [Quantlib-users] Understanding HullWhite::tree method Hi. I can’t completely answer your questions yet; but have made some progress after going through the code and the suggested paper. The code looks a numerical implementation of Hull-White. I have also referenced another book “Options, Futures, and Other Derivatives” by Hull; that book’s chapter 30 have some introductions to the H-W numerical procedure. Do you have access to the book? And, I guess we can again find helpful discussions in: Fabio Mercurio’s book “Interest Rate Models”, Hull’s paper “Numerical procedures for implementing term structure models I: Single-Factor Models”, and Hull’s book “Interest Rate Derivatives”. Unfortunately I haven’t got access to those references. Do you have them? Look forward to more discussions. Regards, Hong Yu From: Smith, Dale Sent: Friday, June 24, 2011 11:35 PM To: qua...@li... Subject: [Quantlib-users] Understanding HullWhite::tree method Hello, I have questions about the implementation of HullWhite::tree. I’ve reproduced the code from hullwhite.cpp here for reference: boost::shared_ptr<Lattice> HullWhite::tree(const TimeGrid& grid) const { TermStructureFittingParameter phi(termStructure()); boost::shared_ptr<ShortRateDynamics> numericDynamics( new Dynamics(phi, a(), sigma())); boost::shared_ptr<TrinomialTree> trinomial( new TrinomialTree(numericDynamics->process(), grid)); boost::shared_ptr<ShortRateTree> numericTree( new ShortRateTree(trinomial, numericDynamics, grid)); typedef TermStructureFittingParameter::NumericalImpl NumericalImpl; boost::shared_ptr<NumericalImpl> impl = boost::dynamic_pointer_cast<NumericalImpl>(phi.implementation()); impl->reset(); for (Size i=0; i<(grid.size() - 1); i++) { Real discountBond = termStructure()->discount(grid[i+1]); const Array& statePrices = numericTree->statePrices(i); Size size = numericTree->size(i); Time dt = numericTree->timeGrid().dt(i); Real dx = trinomial->dx(i); Real x = trinomial->underlying(i,0); Real value = 0.0; for (Size j=0; j<size; j++) { value += statePrices[j]*std::exp(-x*dt); x += dx; } value = std::log(value/discountBond)/dt; impl->set(grid[i], value); } return numericTree; } My questions are 1. What is the difference between numericTree->statePrices(i) and trinomial->underling(i,0)? Aren’t the values returned by underlying(…) the actual short rates obtained from the H-W model? What is returned by statePrices? What would value be just before the impl->set(…) statement? 2. What should I expect in numericTree upon return? I would expect the actual short rates (or discount factors) simulated by the H-W model but I don’t think this is true. See question 1. At first I thought tree(…) returned what I wanted – an actual array (Lattice) of interest rate paths with short rates (or discount factors) simulated by the H-W model. I could then use these rates to calculate cashflows. But perhaps I’m missing something. Before sending this email, I read the HW paper “Using Hull-White Interest Rate Trees”, searched the Quantlib examples and testsuite, read the class module documentation, the source code, and documents on http://quantlib.org/docs.shtml. Please provide any additional pointers to docs I can use to understand this, or perhaps some pointers to sample code I missed that would help. Additionally, I can provide a summary back to the list for future reference. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Office: 678-375-5315 Mobile: 678-982-6599 Mail: dal...@fi... www.fiserv.com -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense.. http://p.sf.net/sfu/splunk-d2d-c1 -------------------------------------------------------------------------------- _______________________________________________ QuantLib-users mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-users |