2

trying to build the spot yield curve for AUD by using the following data from bloomberg, RBACOR Index The Reserve Bank of Australia interbank overnight cash rate 0.03 ADBB1M 1m bank bill 0.005 ADBB2M 2m bank bill 0.015 ADBB3M 3m bank bill 0.015 the data is from last Friday 2021-08-13, however the below code returns me error RuntimeError: convergence not reached after 99 iterations; last improvement 4.45714e-05, required accuracy 1e-12. I can reduce the accuracy to 1e-04 to make this work but wanted to check what went wrong here? it looks like the 1m bank bill rate is surprisingly low while the overnight cash rate is too high. any help/comments are welcome/appreciated.

dateStr = '2021-07-30'
pricingDate = ql.DateParser.parseFormatted(dateStr, '%Y-%m-%d')

depoHelpers = []
depoHelpers.append(ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(0.03/100)),
                                        ql.Period(1, ql.Days),
                                        2,
                                        ql.Australia(),
                                        ql.ModifiedFollowing,
                                        False,
                                        ql.Actual365Fixed()))


depoHelpers.append(ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(0.0051/100)),
                                        ql.Period('1M'),
                                        2,
                                        ql.Australia(),
                                        ql.ModifiedFollowing,
                                        False,
                                        ql.Actual365Fixed()))

depoHelpers.append(ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(0.015/100)),
                                        ql.Period('2M'),
                                        2,
                                        ql.Australia(),
                                        ql.ModifiedFollowing,
                                        False,
                                        ql.Actual365Fixed()))

depoHelpers.append(ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(0.015/100)),
                                        ql.Period('3M'),
                                        2,
                                        ql.Australia(),
                                        ql.ModifiedFollowing,
                                        False,
                                        ql.Actual365Fixed()))

yieldcurve = ql.PiecewiseLogCubicDiscount(pricingDate,
                                      depoHelpers,
                                      ql.Actual360())

yieldcurve.enableExtrapolation()
yieldcurve.dates()
ql.user2511
  • 369
  • 2
  • 12
user51725
  • 31
  • 2
  • You do have a pretty contorted curve, mixing spot OIS and bill yields: starts at 3bp, drops to 0.5bp, back up to 1.5bp, then flat. I would have thought that any method would struggle to fit that many turning points in such a compressed period. The 1m -> 6m OIS rates are flat at 3bp. Any reason you are using bill yields? (cf same happens in Germany: EONIA (ie spot OIS) at -48bp, but 1m Bubill around -70bp.). Are you trying to build a bond or swap yield curve? – DS_London Aug 25 '21 at 15:05
  • i'm trying to build a discount curve for AUD – user51725 Aug 27 '21 at 01:45
  • If you are trying to build a AUD OIS discount curve, you might be better using OIS rates for the 1m to 6m, eg `ADSOA Curncy` (for 1m) to `ADSOF Curncy` (for 6m). That said, I'm not an expert on the AUD short-end, so others might differ on this. You could specify the IAUS source (eg `ADSOA IAUS Curncy') if you are happy to use ICAP pricing. – DS_London Aug 27 '21 at 09:11
  • okay thank you. will take a look. – user51725 Aug 30 '21 at 05:58
  • actually, i just tried using ADSOA, ADSOB, ADSOC as 1m, 2m, 3m which have same value 0.028 as of Aug 13th. then plus RBACOR Index which has value 0.03 as of Aug 13th, I still have the convergence error. – user51725 Aug 30 '21 at 06:18

1 Answers1

2

For most interpolations, moving a node only has effect on the nearest intervals. In cubic (or log cubic) interpolation, instead, moving a node has an effect on the whole curve.

This means that, as the bootstrapping process loops over dates, adding new nodes might cause earlier instruments to no longer be repriced exactly. To avoid this, when using cubic interpolation, the bootstrapping loop is repeated until the nodes converge to a final curve that reprices all instruments.

In your case, the convergence is not reached. It might be that you have a small number of nodes and the curve is too constrained, or it might also have to do with using deposits only, which don't actually use interpolated values.

Using a curve with a different interpolation, such as for instance ql.PiecewiseLogLinearDiscount, will avoid the additional convergence loop and the error you're getting.

Luigi Ballabio
  • 4,128
  • 21
  • 29
  • thanks, using log linear works, although i'm wondering which one is better, reduce the convergence accuracy to 1e-05 or just use log linear interpolation method – user51725 Aug 30 '21 at 06:00