Yield and Risk Metrics for Bonds with Irregular Coupon Schedules
Summary
The document raises a fixed-income valuation problem: how to calculate yield to maturity, dirty price, duration, and related measures for a bond that pays coupons on a nonstandard interval. It describes a QuantLib setup with a 26-week schedule, a Russian business calendar, a specified day-count convention, and a clean price, then reports that requesting semiannual compounding produces a yield different from the yield used in the example.
The question suspects the frequency argument may be responsible and asks how to handle the irregular schedule correctly. However, no answer or validated calculation is included, so the document does not establish which convention or library method resolves the discrepancy. The setup is useful as a practical example of how schedule generation, settlement, day count, compounding, and coupon frequency interact in bond analytics, but readers should not treat the reported output as a general QuantLib rule or verified result.
Key ideas
- Irregular coupon intervals can complicate yield and risk calculations in bond analytics software.
- The example constructs a bond with coupons scheduled every 26 weeks and a specified calendar and day-count convention.
- The reported yield differs from the example's assumed yield when semiannual compounding is requested.
- The document asks how to calculate yield, dirty price, and duration but provides no resolution or validated methodology.
Tags
Full text
# Using QuantLib for bonds with irregular coupon payments
# Using QuantLib for bonds with irregular coupon payments
Could you please help properly use QuantLib python library to estimate different metrics of bond with uncommon coupon payment periods? For example, I have a bond, which pays coupon each 182 day (26 weeks). Following code sets up the schedule and the bond:
```
issueDate = ql.Date(19,6,2019) #05.06.2019
maturityDate = ql.Date(16,3,2039) #16.03.2039
tenor = ql.Period('26W')
calendar = ql.Russia()
bussinessConvention = ql.Following
#bussinessConvention = ql.Unadjusted
dateGeneration = ql.DateGeneration.Backward
monthEnd = False
schedule = ql.Schedule (issueDate, maturityDate, tenor, calendar, bussinessConvention, bussinessConvention, dateGeneration, monthEnd)
dayCount = ql.Actual365Fixed()
compounding = ql.Compounded
cleanPrice = 105.45
ytm = 0.0728
couponRate = 0.077
coupons = [couponRate]
settlementDays = 1
faceValue = 100
fixedRateBond = ql.FixedRateBond(settlementDays, faceValue, schedule, coupons, dayCount)
```
The seems correct, but when I try to calculate YTM I got wrong result (should be 7.28%) probably due to ql.Semiannual freqency:
```
fixedRateBond.bondYield(cleanPrice, dayCount, ql.Compounded, ql.Semiannual)
7.170206456184388
```
Is there any away to correctly estimate YTM, dirtyPrice, duration and other things for such bond?Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.