Hello,
I want to use the Hull White 1F and the CIR 1F implementations to generate explicit short rate/intensity paths. Could someone please point me to the relevant example or unit test to get me started, especially for the latter? Below I'll try to give details on what I've been trying so far, please excuse the verbosity. Any other comments or hints would of course be greatly appreciated! best regards Kamtsa -- Details to what I've done so far, and where I'm stuck/unsure: >From externally provided calibration/model parameters: HW( yield termstructure, mean rev, model vol) CIR( survival termstructure, mean rev, model vol, initial intensity, ...) and a set of dates {T_0,T_1...T_N}, I basically want to obtain the short rates {r_1...r_N} (HW) , intensity {lam1,..lambdaN} (CIR). along different paths (for HW under the T_N forward measure, for CIR under RN) Hull-White short rate: For the HW model I adapted the code used (in different context) in the HestonHW hybrid model unit test: 1) use a "PathGenerator" with a "ForwardMeasureProcess1D" and a "TimeGrid" to obtain {r_1...r_N}. 2) Then use model in class "HullWhite" (with same model parameters) to get ZCB B(T_X, T_Y) given spot rate r_X obtained in step 1). I hope the above is (one) correct way to do this? The result seem ok from visually inspection, but I didn't have time/possibility to verify output ('academic' project on the side). CIR intensity: Next I need to do the same thing for the CIR process. Basically I want to simulate 'spot' intensities along a path, and then obtain the (implied, future) survival probabilities P(T_X,T_Y), given spot intensity at time T_X. I couldn't not find the exact equivalent of the rate version above (YieldTermStructure->DefaultProbabilityTermStructure etc.), is there a ready example/unit test for this I could learn from? Alternatively, can I leverage on the "short rate <-> intensity" equivalence and express everything in terms of short rates, and interpret discount bond as survival probabilities (I don't need interace defaultProbability(), would be happy with discountBond() as above). Will anything bad happens along the way, anybody tried that before? 1) [Generate path for intensity, stuck here, see above for two alternatives]. 2) Given spot intensity obtain SurvivalProbability: Same as above, I tried using model in class "ExtendedCoxIngersollRoss" to get ZCB B(T_X, T_Y) given spot intensity lambda_X obtained in step 1). ExtendedCoxIngersollRoss model(...); SurvProb = model->discountBond(timeStart, timeEnd, spot_intensity_at_start); Generally, I do not need calibration or an pricing engine or similar, just the underlying path of short rate and intensity. I'm fairly new to actually using ql but have been playing around with it for some time. Compilation and linking to my code under VS2008 works. ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Sat, 2010-10-02 at 12:49 +1000, Kamtsa Dragoslav wrote:
> I want to use the Hull White 1F and the CIR 1F implementations to > generate explicit short rate/intensity paths. Could someone please > point me to the relevant example or unit test to get me started, > especially for the latter? I'm afraid we're short on examples, but you might want to look in <ql/processes>, especially hullwhiteprocess.hpp. I don't remember exactly what paths are generated if you plug the processes there in a PathGenerator (short-rate, I guess, but I'm not certain) but at least it might give you an idea on how to implement a CIR process (which, I'm afraid, we don't have at this time.) Luigi -- When all else fails, pour a pint of Guinness in the gas tank, advance the spark 20 degrees, cry "God Save the Queen!", and pull the starter knob. -- MG "Series MGA" Workshop Manual ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |