Hi,
Please, let me know if there are some solution to the following problem:
I am creating an YieldTermStructure object based on DepositRateHelper and SwapRateHelpers
The creation of the object looks like:
m_YieldTermStructurePtr = YieldTermStructurePtr(
new PiecewiseYieldCurve<ZeroYield,LogLinear>(
m_nSettlementDays,
m_Calendar,
m_RateHelperVec,
m_TermStructureDayCounter,
std::vector<Handle<Quote> >(),
std::vector<Date>(),
m_dTolerance));
Where m_RateHelperVec is a vector of RateHelper objects, every one of them has a dependancy on SimpleQuote object.
This YieldTermStructure used in swap calculations to find a fairRate.
I am doing historical calculations and
for every historical date I am changing SimpleQuotes values and Settings::instance().evaluationDate()
I found that the process of changing the shape of YieldTermStructure via SimpleQuotes mutations takes a lot of cpu time.(It is probably because every benchmark quote notify all observers.) Any suggestions how I can speed
up the update of Quotes,please?
Thanks,
Sergey Andreyev
********************************************************************This message (including any attachments) is confidential and/or privileged. It is to be used by the intended recipients only. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are inherently insecure and susceptible to change. The Royal Bank of Scotland Group, plc ("RBS") and its US subsidiaries, and affiliates and subsidiary undertakings, including but not limited to, RBS plc New York and Connecticut Branches, RBS Securities Inc., ABN AMRO Bank N.V. New York and Chicago Branches and, ABN AMRO Incorporated, Citizens Financial Group, Inc. and RBS Citizens, N.A., shall not be liable for the improper or incomplete transmission of the information contained in this communication or Attachment nor for any delay in its receipt or damage to your system. RBS does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. RBS and its subsidiaries and affiliates do not guarantee the accuracy of any email or attachment, that an email will be received or that RBS or its affiliates and subsidiaries will respond to an email. RBS makes no representations that any information contained in this message (including any attachments) are appropriate for use in all locations or that transactions, securities, products, instruments or services discussed herein are available or appropriate for sale or use in all jurisdictions, or by all investors or counterparties. Those who utilize this information do so on their own initiative and are responsible for compliance with applicable local laws or regulations.******************************************************************** ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Fri, 2009-07-24 at 16:19 -0400, [hidden email] wrote:
> I am creating an YieldTermStructure object based on DepositRateHelper > and SwapRateHelpers > I am doing historical calculations and > for every historical date I am changing SimpleQuotes values and > Settings::instance().evaluationDate() > > I found that the process of changing the shape of YieldTermStructure > via SimpleQuotes mutations takes a lot of cpu time.(It is probably > because every benchmark quote notify all observers.) Any suggestions > how I can speed up the update of Quotes,please? I'd guess it's more the change of evaluation date than the quotes. May you try running your loop when changing only the evaluation date or only the quotes? That way you could see what takes the most time... Luigi -- There is no likelihood man can ever tap the power of the atom. -- Robert Millikan, Nobel Prize in Physics, 1923 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thanks Luigi,
I finally made a test and it looks like that you were absolutely right. The main time spent in call Settings::instance().evaluationDate() = tEvalDate; The quote update time looks negligible. Even swap->fairRate takes much less time then switching the evalDate. Test was done for one swap and 365 days of Libor surface. Results in CPu ticks: QuotesUpdate 16 ticks EvalDateUpdate 81663 ticks FairRateCalc 15385 ticks Interesting enough that I had a completely different impression when run code in debug mode. So, the question changes to: am I using the right call when moving historical date? Thanks, Sergey Andreyev RBS Global Banking & Markets Office: +1 203 897 6224 -----Original Message----- From: Luigi Ballabio [mailto:[hidden email]] Sent: Friday, July 31, 2009 9:35 AM To: Andreyev, Sergey, GBM Cc: [hidden email] Subject: Re: [Quantlib-users] Speed optimization for YieldTermStructure calculations? On Fri, 2009-07-24 at 16:19 -0400, [hidden email] wrote: > I am creating an YieldTermStructure object based on DepositRateHelper > and SwapRateHelpers > I am doing historical calculations and for every historical date I am > changing SimpleQuotes values and > Settings::instance().evaluationDate() > > I found that the process of changing the shape of YieldTermStructure > via SimpleQuotes mutations takes a lot of cpu time.(It is probably > because every benchmark quote notify all observers.) Any suggestions > how I can speed up the update of Quotes,please? I'd guess it's more the change of evaluation date than the quotes. May you try running your loop when changing only the evaluation date or only the quotes? That way you could see what takes the most time... Luigi -- There is no likelihood man can ever tap the power of the atom. -- Robert Millikan, Nobel Prize in Physics, 1923 *****Please note that my email address may have changed. For all future correspondence, please use this address***** ********************************************************************This message (including any attachments) is confidential and/or privileged. It is to be used by the intended recipients only. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are inherently insecure and susceptible to change. The Royal Bank of Scotland Group, plc ("RBS") and its US subsidiaries, and affiliates and subsidiary undertakings, including but not limited to, RBS plc New York and Connecticut Branches, RBS Securities Inc., ABN AMRO Bank N.V. New York and Chicago Branches and, ABN AMRO Incorporated, Citizens Financial Group, Inc. and RBS Citizens, N.A., shall not be liable for the improper or incomplete transmission of the information contained in this communication or Attachment nor for any delay in its receipt or damage to your system. RBS does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. RBS and its subsidiaries and affiliates do not guarantee the accuracy of any email or attachment, that an email will be received or that RBS or its affiliates and subsidiaries will respond to an email. RBS makes no representations that any information contained in this message (including any attachments) are appropriate for use in all locations or that transactions, securities, products, instruments or services discussed herein are available or appropriate for sale or use in all jurisdictions, or by all investors or counterparties. Those who utilize this information do so on their own initiative and are responsible for compliance with applicable local laws or regulations.******************************************************************** ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Thu, 2009-08-06 at 08:51 -0400, [hidden email] wrote:
> I finally made a test and it looks like that you were absolutely right. The main time spent in call > Settings::instance().evaluationDate() = tEvalDate; > > The quote update time looks negligible. That's probably because when the date changes the SwapRateHelpers recalculate the schedule of their underlying swaps and re-instantiate them. > So, the question changes to: am I using the right call when moving historical date? It's the right call. I'm afraid there's not much to do except trying to optimize the code... Luigi -- Can't act. Slightly bald. Also dances. -- RKO executive, reacting to Fred Astaire's screen test. Cerf/Navasky, "The Experts Speak" ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Luigi/Sergey
How about including a if statement? The line of code would run just if tEvalDate is not equal to current evaluation date. Does it make sense or I am missing some behaviour of QuantLib (and QuantLibXL)? Regards, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Fri, 2009-08-07 at 07:05 -0300, Piter Dias wrote:
> > > Settings::instance().evaluationDate() = tEvalDate; > > > > It's the right call. I'm afraid there's not much to do except trying > > to > > optimize the code... > > > > > How about including a if statement? The line of code would run just if > tEvalDate is not equal to current evaluation date. The if statement is already there. The problem is that the date does change (Sergei's doing historical analysis) and all swap helpers recalculate their dates. Luigi -- There is no likelihood man can ever tap the power of the atom. -- Robert Millikan, Nobel Prize in Physics, 1923 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |