2
$\begingroup$

I'm using the rateslib Python package to build a yield curve from Brazilian DI1 futures using piecewise/spline interpolation. My expectation was that changing the day count convention of the curve itself (e.g. from 'bus252' to 'act360') wouldn't affect the discount factors much, assuming the instruments and rates used to solve the curve are unchanged.

However, when I change the convention of the curve from 'bus252' to 'act360', I get noticeably different discount factors when querying the curve at the same date.

For example,

mixed_curve[dt.datetime(2026, 6, 24)] 

returns:

0.871460 for convention='bus252' 0.869912 for convention='act360'

Here’s the curve setup code (plot for the code also attached): mixed_curve plot

di1_info = {'N25': 14.90, 'Q25': 14.91, 'U25': 14.93, 'V25': 14.94, 'X25': 14.94, 'Z25': 14.94, 'F26': 14.94, 'G26': 14.94, 'H26': 14.92, 'J26': 14.90, 'K26': 14.83, 'M26': 14.80, 'N26': 14.73, 'V26': 14.48, 'F27': 14.21, 'J27': 14.00, 'N27': 13.79, 'V27': 13.61, 'F28': 13.46, 'J28': 13.37, 'N28': 13.34, 'V28': 13.33, 'F29': 13.32, 'J29': 13.33, 'N29': 13.35, 'V29': 13.35, 'F30': 13.39, 'J30': 13.41, 'N30': 13.43, 'F31': 13.48, 'F32': 13.55, 'F33': 13.58, 'F34': 13.58, 'F35': 13.61 } ... bra = rateslib.Cal(holidays=[dat.strptime(_, "%Y-%m-%d") for _ in di1_pricing_holidays], week_mask=[5, 6]) mixed_curve = rateslib.curves.Curve( nodes= discount_estimate_nodes, interpolation="log_linear", t = t, id="mixed_curve", calendar = bra, convention='Act360' ) zcs_args = dict(frequency="A", calendar=bra, curves="mixed_curve", currency="brl", convention="bus252") instruments = [] for element in di1_intervals: date1 = dt.datetime(element[0].year, element[0].month, element[0].day) date2 = dt.datetime(element[1].year, element[1].month, element[1].day) instruments.append(rateslib.ZCS(date1, date2, **zcs_args)) solver = rateslib.Solver( curves=[mixed_curve], instruments=instruments, s=di1_rates, algorithm = "levenberg_marquardt" ) 

My question: Why does changing the convention parameter of the curve object change the resulting discount factors, even when all instrument inputs and solver settings are unchanged?

$\endgroup$
2
  • 1
    $\begingroup$ read this: rateslib.com/py/en/2.0.x/z_bus252_convention.html $\endgroup$ Commented Jun 25 at 18:36
  • $\begingroup$ and note the changelog of the v2.0.0 release: "The ‘linear’ and ‘log_linear’ interpolation methods of a Curve now automatically adjust to business day interpolation when using a ‘bus252’ convention". $\endgroup$ Commented Jun 25 at 18:40

1 Answer 1

2
$\begingroup$

besides the interpolation, Brazilian BUS/252 behaves differently from other daycounts, that accrue on calendar days, in that: the numerator of the period fraction has at least $\frac{2}{7}\approx.29$ fewer days, because Saturdays and Sundays are not accruing. There are also many Brazil holidays that sometimes cluster. For example, the Carnival is Monday through (Ash) Wednesday; and both Good Friday and Easter Monday are not accruing.

The denominator is $\frac{365-252}{365}\approx.31$ which doesn't exactly offset the difference in days of accrual. The fraction for a short period that also includes Brazil holidays can turn out to be surprisingly different from 30/360 or Actual/365.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.