Hi,
Can someone please explain to me what is going on in the three last line of code in Matthias Gronckis blog post (https://ipythonquant.wordpress.com/2015/05/02/exposure-simulation-pfe-and-cva-for-multi-callable-swaps-bermudan-swaptions-part-1-of-3/ )about CVA/exposure for bermudan swaptions? I am confused about how he deals with discount factors and numeraires. # Apply payoff function npv[npv < 0] = 0 # Deflate NPV npv = npv / numeraires[:,-1] npv = np.mean(npv) * numeraires[0,0] Why does he need to deflate the NPV? And what does the syntax numeraires[:,-1] do? I am programming something similar in C++, so I would really appreciate a few comments about this. Thanks! |
Hi, I am using the T-forward measure and the zerobond maturing in T years is my numeraire. The deflated payoff of the swaption (expressed in units of the numeraire) is a martingale. For each simulated path I store the payout at expiry t_e in the array *npv* (for each path one row) . Further I store for each simulated path and point on the timegrid (0,t_e) the simulated numeraire in the 2-dimensional array (row = simulations, columns=times) *numeraires*. npv = npv / numeraires[:,-1] is an element-wise operation. It divides each payout with the corresponding numeraire at time t_e. numeraires[:,-1] returns all rows for the last column (all numeraires at time t_e). Matthias Hi,
Can someone please explain to me what is going on in the three last line of code in Matthias Gronckis blog post (https://ipythonquant.wordpress.com/2015/05/02/exposure-simulation-pfe-and-cva-for-multi-callable-swaps-bermudan-swaptions-part-1-of-3/ )about CVA/exposure for bermudan swaptions? I am confused about how he deals with discount factors and numeraires. # Apply payoff function npv[npv < 0] = 0 # Deflate NPV npv = npv / numeraires[:,-1] npv = np.mean(npv) * numeraires[0,0] Why does he need to deflate the NPV? And what does the syntax numeraires[:,-1] do? I am programming something similar in C++, so I would really appreciate a few comments about this. Thanks! -- View this message in context: http://quantlib.10058.n7.nabble.com/Fundamental-pricing-question-regarding-Numeraires-tp16607.html Sent from the quantlib-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thank you Matthias!
Okey, I believe I understand it. But what if I wanted to do the same pricing under the risk neutral measure Q, would that work? Or would I have to use a two curve setup with a OIS curve for risk neutral discounting? |
Hello,
you are mixing things up a bit here. One thing is which numeraire / measure you use for pricing => this is always the zero bond P(t,T) / T-forward measure in the Gsr implementation that Matthias uses in his Python code. Another thing is whether you want to use a multicurve setup or not. You can do that (using static adjustments for basis spreads) in the Gsr model, if you want, e.g. use an OIS curve for discounting and tenor forward curves, but the measure is still T-forward, yet with a zero bond reflecting OIS rates. The same would hold in an implementation under the risk neutral measure, which can be done single- or multi-curved. best regards Peter On 31 May 2015 at 19:06, vgdev <[hidden email]> wrote: > Thank you Matthias! > > Okey, I believe I understand it. But what if I wanted to do the same pricing > under the risk neutral measure Q, would that work? Or would I have to use a > two curve setup with a OIS curve for risk neutral discounting? > > > > -- > View this message in context: http://quantlib.10058.n7.nabble.com/Fundamental-pricing-question-regarding-Numeraires-tp16607p16610.html > Sent from the quantlib-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |