Re: Fundamental pricing question regarding Numeraires

Posted by Matthias Groncki on
URL: http://quantlib.414.s1.nabble.com/Fundamental-pricing-question-regarding-Numeraires-tp16607p16609.html

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

Von: [hidden email]
Gesendet: ‎Sonntag‎, ‎31‎. ‎Mai‎ ‎2015 ‎17‎:‎36
An: [hidden email]

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