# QuantLib_InterestRate man page

InterestRate — Concrete interest rate class.

## Synopsis

`#include <ql/interestrate.hpp>`

### Public Member Functions

**constructors**

InterestRate()

Default constructor returning a null interest rate.InterestRate(Rater, constDayCounter&dc,Compoundingcomp,Frequencyfreq)

Standard constructor.

**conversions**

operator Rate() const

**inspectors**

Rate rate() const

constDayCounter&dayCounter() constCompounding compounding() constFrequency frequency() const

**discount/compound factor calculations**

DiscountFactor discountFactor(Timet) const

discount factor implied by the rate compounded at time t.DiscountFactor discountFactor(constDate&d1, constDate&d2, constDate&refStart=Date(), constDate&refEnd=Date()) const

discount factor implied by the rate compounded between two datesReal compoundFactor(Timet) const

compound factor implied by the rate compounded at time t.Real compoundFactor(constDate&d1, constDate&d2, constDate&refStart=Date(), constDate&refEnd=Date()) const

compound factor implied by the rate compounded between two dates

**equivalent rate calculations**

InterestRate equivalentRate(Compoundingcomp,Frequencyfreq,Timet) const

equivalent interest rate for a compounding period t.InterestRate equivalentRate(constDayCounter&resultDC,Compoundingcomp,Frequencyfreq,Dated1,Dated2, constDate&refStart=Date(), constDate&refEnd=Date()) const

equivalent rate for a compounding period between two dates

### Static Public Member Functions

**implied rate calculations**

staticInterestRate impliedRate(Realcompound, constDayCounter&resultDC,Compoundingcomp,Frequencyfreq,Timet)

implied interest rate for a given compound factor at a given time.

staticInterestRate impliedRate(Realcompound, constDayCounter&resultDC,Compoundingcomp,Frequencyfreq, constDate&d1, constDate&d2, constDate&refStart=Date(), constDate&refEnd=Date())

implied rate for a given compound factor between two dates.

### Related Functions

(Note that these are not member functions.)

std::ostream &operator<<(std::ostream &, constInterestRate&)

## Detailed Description

Concrete interest rate class.

This class encapsulate the interest rate compounding algebra. It manages day-counting conventions, compounding conventions, conversion between different conventions, discount/compound factor calculations, and implied/equivalent rate calculations.

**Tests**

Converted rates are checked against known good results

**Examples:** **CallableBonds.cpp**.

## Member Function Documentation

### DiscountFactor discountFactor (Time t) const

discount factor implied by the rate compounded at time t.

**Warning**

Time must be measured using **InterestRate**'s own day counter.

### Real compoundFactor (Time t) const

compound factor implied by the rate compounded at time t. returns the compound (a.k.a capitalization) factor implied by the rate compounded at time t.

**Warning**

Time must be measured using **InterestRate**'s own day counter.

### Real compoundFactor (const Date & d1, const Date & d2, const Date & refStart = Date(), const Date & refEnd = Date()) const

compound factor implied by the rate compounded between two dates returns the compound (a.k.a capitalization) factor implied by the rate compounded between two dates.

### static InterestRate impliedRate (Real compound, const DayCounter & resultDC, Compounding comp, Frequency freq, Time t) [static]

implied interest rate for a given compound factor at a given time. The resulting **InterestRate** has the day-counter provided as input.

**Warning**

Time must be measured using the day-counter provided as input.

### static InterestRate impliedRate (Real compound, const DayCounter & resultDC, Compounding comp, Frequency freq, const Date & d1, const Date & d2, const Date & refStart = Date(), const Date & refEnd = Date()) [static]

implied rate for a given compound factor between two dates. The resulting rate is calculated taking the required day-counting rule into account.

### InterestRate equivalentRate (Compounding comp, Frequency freq, Time t) const

equivalent interest rate for a compounding period t. The resulting **InterestRate** shares the same implicit day-counting rule of the original **InterestRate** instance.

**Warning**

Time must be measured using the **InterestRate**'s own day counter.

### InterestRate equivalentRate (const DayCounter & resultDC, Compounding comp, Frequency freq, Date d1, Date d2, const Date & refStart = Date(), const Date & refEnd = Date()) const

equivalent rate for a compounding period between two dates The resulting rate is calculated taking the required day-counting rule into account.

## Friends And Related Function Documentation

## Author

Generated automatically by Doxygen for QuantLib from the source code.

## Referenced By

compoundFactor(3), equivalentRate(3), impliedRate(3) and InterestRate(3) are aliases of QuantLib_InterestRate(3).