The class implements the concept of interest rate. More...
#include <interestRate.hpp>
Public Member Functions | |
InterestRate () | |
Constructor. More... | |
InterestRate (const SmartPointer< Compounding > &compounding, const SmartPointer< YearFraction > &year_fraction) | |
Constructor. More... | |
double | capitalization (Date date1, Date date2, double interest_rate) const |
Calculates capitalization. More... | |
double | DF (Date date1, Date date2, double interest_rate) const |
Calculates discount factor. More... | |
double | coupon (Date date1, Date date2, double interest_rate) const |
Calculates coupon. More... | |
double | fwdRate (Date date1, Date date2, double df1, double df2) const |
Calculates forward rate. More... | |
double | zcRate (Date date1, Date date2, double df) const |
Calculates zero coupon rate. More... | |
double | yf (Date date1, Date date2) const |
Calculates year fraction. More... | |
InterestRate * | clone () const |
Virtual copy constructor. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
interface used by Boost serialization library More... | |
Private Attributes | |
SmartPointer< Compounding > | compounding_ |
Attribute maintaining compounding convention. More... | |
SmartPointer< YearFraction > | year_fraction_ |
Attribute maintaining year fraction convention. More... | |
Friends | |
class | boost::serialization::access |
std::ostream & | operator<< (std::ostream &s, InterestRate &r) |
Overloads stream operator. More... | |
Detailed Description
The class implements the concept of interest rate.
Class represent the interest rate concept. It encapsulates compounding algebra and year fraction conventions. It allows to calculate capitalization of capital and coupon paid by investment. It also enables to calculate discount factors, zero coupon rates and forward rates if appropriate data provided.
- Examples:
- algebraicBootstrapperExample.cpp, bondsExample.cpp, bootstrapperComparison.cpp, constrainedBootstrapperExample.cpp, DepositExample.cpp, InterestRateExample.cpp, optionPricingExample.cpp, rootFindingBootstrapperExample.cpp, serializationExample.cpp, and unconstrainedBootstrapperExample.cpp.
Constructor & Destructor Documentation
julian::InterestRate::InterestRate | ( | ) |
Constructor.
Method creates the interest rate instance on the basis of compounding and year fraction convention.
julian::InterestRate::InterestRate | ( | const SmartPointer< Compounding > & | compounding, |
const SmartPointer< YearFraction > & | year_fraction | ||
) |
Constructor.
Method creates the interest rate instance on the basis of compounding and year fraction convention.
Member Function Documentation
Calculates capitalization.
This method calculates the future value of 1 monetary unit. More specifically it calculates what is the value of 1 monetary unit invested on date1 at a rate of r per year. The investment ends at date2. The compounding and year fraction convention is defined during construction of the interest rate object.
- Examples:
- InterestRateExample.cpp.
InterestRate * julian::InterestRate::clone | ( | ) | const |
Virtual copy constructor.
Method is an implementation of virtual copy constructor.
Calculates coupon.
This method calculates the yield of investment that starts at date1 and ends at date2. The interest rate value should be provided. The compounding and year fraction convention is defined during construction of the interest rate object.
- Examples:
- InterestRateExample.cpp.
Calculates discount factor.
This method calculates the present value of 1 monetary unit. More specifically it calculates how many monetary units should be invested at date1 at a rate of r per year in order to receive 1 monetary unit at date2. The compounding and year fraction convention is defined during construction of the interest rate object.
- Examples:
- InterestRateExample.cpp.
Calculates forward rate.
This methods calculate forward rate on the basis of two discount factors and two dates. The forward rate is the interest rate for the investment that starts at future date date1 and ends at date2. The compounding and year fraction convention is defined during construction of the interest rate object.
- Examples:
- InterestRateExample.cpp.
|
inline |
interface used by Boost serialization library
Calculates year fraction.
This methods calculates the year fraction between two dates. The year fraction convention is defined during the construction of interest rate object.
Calculates zero coupon rate.
This methods calculate zero coupon rate on the basis of discount factor and two dates. The zero coupon rate is the interest rate for the investment that starts at date1 and ends at datd2. The compounding and year fraction convention is defined during construction of the interest rate object.
- Examples:
- InterestRateExample.cpp.
Friends And Related Function Documentation
|
friend |
Overloads stream operator.
This overloaded operator enables to print the curve on the console.
Member Data Documentation
|
private |
Attribute maintaining compounding convention.
This is the compounding convention used by interest rate class. It is provided during the construction of the object
|
private |
Attribute maintaining year fraction convention.
This is the year fraction convention used by interest rate class. It is provided during the construction of the object
The documentation for this class was generated from the following files:
- C:/Unix/home/OEM/jULIAN/src/interestRates/interestRate.hpp
- C:/Unix/home/OEM/jULIAN/src/interestRates/interestRate.cpp