Comparing Flat-Curve Bond Pricing with Yield-Based Pricing
Summary
The document asks whether a fixed-rate bond priced with a flat discount curve produces the same result as pricing it directly from a specified yield. It compares two RQuantLib functions and notes that the curve-based function can return more than a single clean price, including dirty price, accrued interest, and cash-flow information.
The text frames a software and fixed-income pricing question but does not supply a comparison, formulas, or empirical output. It therefore does not establish whether the clean prices match under identical conventions. Any comparison would need consistent settlement and evaluation dates, coupon and day-count conventions, compounding, and treatment of accrued interest. The distinction between clean and dirty price is the main practical point raised; further conclusions require checking the functions' assumptions and outputs.
Key ideas
- A flat discount curve and a yield input are two ways to parameterize fixed-rate bond valuation.
- The functions under discussion may return different sets of outputs, including accrued interest and cash-flow details.
- Clean price excludes accrued interest, while dirty price includes it.
- The document raises the comparison but does not report whether the prices agree under matched conventions.
Tags
Full text
# RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?
# RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?
Please, consider the following functions from `RQuantLib` package:
- `FixedRateBond()`
- `FixedRateBondPriceByYield()`
Is there any difference in the final output if one uses the former specifying a flat term structure, e.g.
```
params <- list(tradeDate = as.Date(’2002-2-15’),
settleDate = as.Date(’2002-2-19’),
dt = .25,
interpWhat = "discount",
interpHow = "loglinear")
setEvaluationDate(as.Date("2004-11-22"))
discountCurve.flat <- DiscountCurve(params, list(flat = 0.05))
```
instead of the latter with `FixedRateBondPriceByYield(..., yield = 0.05, ...)`? (Use the same parameters at `...`).
`FixedRateBondPriceByYield()` should just return bond's clean price, while `FixedRateBond()` can return dirty price in addition to accrued interests and cash flow tables.
Anything else?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.