|
From: Philippe H. <phi...@ex...> - 2021-04-02 03:08:47
|
I have built a Hull-White sequence via standard method, by following
precisely the method in the QuantLib Cookbook, with sigma = 10% and
mean_rev = 10%.
My goal is to ultimately build an OAS model for some Agency CMOs, for which
I am building a Monte-carlo engine.
I also built a Jamshidian engine to compute a closed-form value of a
european swaption as a test, to make sure that my MC valuation converges to
the theoretical value.
The convergence doesn't work, and I think it has to do with the
floating index of the swaption, so let me explain.
I first build a curve name forecastHandle of type
ql.RelinkableYieldTermStructureHandle
I then build a swaption object via my own build_swaption() function, along
the lines of the swaption helpers from the Cookbook approach, which returns
a ql.Swaption() object. The curve handle is passed to the build_swaption()
call along with tenor, maturity and strike.
I build the floating index as follows inside the function:
libor_3m = ql.USDLibor(ql.Period('3M'), forecastHandle)
Now switching to the MC calculation. I loop on all the sequences of
short-term rates generated by my HW sequence. I verified that the expected
value and the variance of the short-rate are the same as in the Cookbook.
Lastly, in order to calculate the value of the swaption via MC integration,
I do the following, which takes place inside a function called
swaption_MC(forecastHandle, my_swaption). Importantly, forecastHandle is
the same handle that was used to build the swaption, including its libor_3m
index.
for i in range(num_paths):
curve = hw_discount_curve(i)
forecastHandle.linkTo(curve)
engine = ql.DiscountingSwapEngine(forecastHandle)
swap = my_swaption.underlyingSwap()
swap.setPricingEngine(engine)
swap_npv = swap.NPV()
sum_pv += max(0, swap_npv)
return sum_pv / num_paths
I was therefore hoping that by linking the forecastHandle to each path-wise
stochastic curve, the libor 3m index would also be path dependent. but
somehow, that doesn't appear to be the case, as the floating rates for each
reset do not change with each stochastic curve. So I am wondering what I am
doing wrong?
Help appreciated.
Philippe Hatstadt
--
Broker-Dealer services offered through Exos Securities LLC, member
of SIPC <http://www.sipc.org/> / FINRA <http://www.finra.org/> /
BrokerCheck <https://brokercheck.finra.org/>/ 2021 Exos, inc. For
important disclosures, click here
<https://www.exosfinancial.com/general-disclosures>.
|