Hi,
I am very new to quantlib, may I know what is the easiest way to shift a YieldTermStructure, at a key rate, say 5 year, up by 10bps? -- Whatever your journey, keep walking. ------------------------------------------------------------------------------ Storage Efficiency Calculator This modeling tool is based on patent-pending intellectual property that has been used successfully in hundreds of IBM storage optimization engage- ments, worldwide. Store less, Store more with what you own, Move data to the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Here is a code snippet to shock the entire curve. Just modify the spread
vector to shock the points you like. std::cout << "Shocking the term structure" << std::endl; std::vector< Date > zeroDates( 180 ); std::vector< Handle< Quote> > spreads( 180 ); for( int t = 1; t < 2; ++t ) { Date date = depoFutSwap->referenceDate() + Period( t, Months ); zeroDates.push_back( date ); spreads.push_back( Handle< Quote >( new SimpleQuote( 0.005 ) ) ); std::cout << date << std::endl; } std::cout << std::endl; Handle< YieldTermStructure > depoFutSwapHandle( depoFutSwap, false ); PiecewiseZeroSpreadedTermStructure curve( depoFutSwapHandle, spreads, zeroDates ); std::cout << "Shocked Spot Rates and Forward Rates (Depo-Fut-Swap)" << std::endl; for( Time t = 0; t < 180; ++t ) { std::cout << t << ", " << curve.zeroRate( t / 12, Compounded ).rate() << ", " << curve.forwardRate( t/12, t/12, Compounded ).rate() << std::endl; } Robert Philipp Synapse Financial Engineering 703.623.4063 (mobile) 703.261.6799 (fax) [hidden email] www.synapsefe.com On 7/22/2011 11:03 PM, Shuo Wang wrote: > Hi, > > I am very new to quantlib, may I know what is the easiest way to shift > a YieldTermStructure, at a key rate, say 5 year, up by 10bps? > ------------------------------------------------------------------------------ Storage Efficiency Calculator This modeling tool is based on patent-pending intellectual property that has been used successfully in hundreds of IBM storage optimization engage- ments, worldwide. Store less, Store more with what you own, Move data to the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Depending on what you are trying to do, you may want to bump the rate/price of one or more market observables and then re-build the curve. In this way you can, for example, work out how well your hedges in the liquid market instruments used that are used to build the curve protect your illiquid portfolio that you are trying to value. This is very easy to as all you need to do is bump the input data by required amount and the curve is automatically rebuilt. I've posted a simple example here: http://www.bnikolic.co.uk/blog/ql-bumping-curve.html -- Bojan Nikolic || http://www.bnikolic.co.uk ------------------------------------------------------------------------------ Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |