#include <LastPeriodCalculator.h>
Inheritance diagram for com::ftlabs::fisa::calc::LastPeriodCalculator:

Public Member Functions | |
| const FISADate * | getInterestAccrualDate (void) const |
| Get the date on which interest begins to accrue for this settlement to redemption period. | |
| double | getPrincipal (int cashFlowIndex) const |
| Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex. | |
| double | getTimeToFlow (int cashFlowIndex) const |
| Get the time to flow for a particular cashflow, as specified by cashFlowIndex. | |
| double | getPeriodicTimeToFlow (int cashFlowIndex) const |
| Get the periodic time to flow as calculated with an actual day count method for a particular cashflow, as specified by cashFlowIndex. This value is generally used in actual convexity and duration methods. | |
| virtual double | calculatePriceValue1BP (double price, double yield) const throw ( CalculationException ) |
| Calculate the average price value obtained by varying the yield up and down one basis point. | |
| double | calculateYieldValue1_32 (double pv1b) const throw ( CalculationException ) |
| Calculate the average yield value obtained by varying the price up and down 1/32. | |
| virtual double | calculateEstimatedMacaulayDuration (double pv1b, double price, double yield) const throw ( CalculationException ) |
| Calculate an estimated Macaulay duration. | |
| double | calculateEstimatedModifiedDuration (double pv1b, double price, double yield) const throw ( CalculationException ) |
| Calculate an estimated modified duration. | |
| virtual double | calculateEstimatedModifiedDuration (double duration, double yield) const throw ( CalculationException ) |
| Calculate the estimated modified duration. | |
| virtual double | calculateEstimatedConvexity (double pv1b, double price, double yield) const throw ( CalculationException ) |
| Calculate an estimated convexity. | |
| double | calculateAccruedIncome (const FISADate &salesDate) const throw ( CalculationException ) |
| Calculates the accrued interest income to the supplied salesDate. | |
Protected Member Functions | |
| LastPeriodCalculator (void) | |
| LastPeriodCalculator (const LastPeriodCalculator &calculator) | |
| LastPeriodCalculator (const FISADate &settlementDate, const FISADate *exDividendDate, const Redemption &redemption, double parValue, double interestRate, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, const HolidaySchedule *holidaySchedule) throw ( CalculationException ) | |
| LastPeriodCalculator & | operator= (const LastPeriodCalculator &calculator) |
| virtual | ~LastPeriodCalculator (void) |
| void | setValues (const FISADate &settlementDate, const FISADate *exDividendDate, const Redemption &redemption, double parValue, double interestRate, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, const HolidaySchedule *holidaySchedule) throw ( CalculationException ) |
Protected Attributes | |
| double | aif |
| double | df |
| double | lcf |
| double | act_df |
| double | ty_df |
| const DayCountBasis * | dayCountBasis |
| double | interestRate |
| bool | eomAdjust |
| FISADate | interestAccrualDate |
| com::ftlabs::fisa::calc::LastPeriodCalculator::LastPeriodCalculator | ( | void | ) | [protected] |
| com::ftlabs::fisa::calc::LastPeriodCalculator::LastPeriodCalculator | ( | const LastPeriodCalculator & | calculator | ) | [protected] |
| com::ftlabs::fisa::calc::LastPeriodCalculator::LastPeriodCalculator | ( | const FISADate & | settlementDate, | |
| const FISADate * | exDividendDate, | |||
| const Redemption & | redemption, | |||
| double | parValue, | |||
| double | interestRate, | |||
| const DayCountBasis & | dayCountBasis, | |||
| int | interestFrequency, | |||
| bool | eomAdjust, | |||
| const HolidaySchedule * | holidaySchedule | |||
| ) | throw ( CalculationException ) [protected] |
| virtual com::ftlabs::fisa::calc::LastPeriodCalculator::~LastPeriodCalculator | ( | void | ) | [protected, virtual] |
| LastPeriodCalculator& com::ftlabs::fisa::calc::LastPeriodCalculator::operator= | ( | const LastPeriodCalculator & | calculator | ) | [protected] |
| void com::ftlabs::fisa::calc::LastPeriodCalculator::setValues | ( | const FISADate & | settlementDate, | |
| const FISADate * | exDividendDate, | |||
| const Redemption & | redemption, | |||
| double | parValue, | |||
| double | interestRate, | |||
| const DayCountBasis & | dayCountBasis, | |||
| int | interestFrequency, | |||
| bool | eomAdjust, | |||
| const HolidaySchedule * | holidaySchedule | |||
| ) | throw ( CalculationException ) [protected] |
| const FISADate* com::ftlabs::fisa::calc::LastPeriodCalculator::getInterestAccrualDate | ( | void | ) | const [virtual] |
Get the date on which interest begins to accrue for this settlement to redemption period.
This method will return dated date if the settlement date is before the first interest date, the coupon date just prior to the settlement date, or the settlement date if it falls on a coupon payment date. This method may not be applicable to all implementations, in which case a 0 should be returned.
Reimplemented from com::ftlabs::fisa::calc::OneCashFlowCalculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::getPrincipal | ( | int | cashFlowIndex | ) | const [virtual] |
Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::getTimeToFlow | ( | int | cashFlowIndex | ) | const [virtual] |
Get the time to flow for a particular cashflow, as specified by cashFlowIndex.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::getPeriodicTimeToFlow | ( | int | cashFlowIndex | ) | const [virtual] |
Get the periodic time to flow as calculated with an actual day count method for a particular cashflow, as specified by cashFlowIndex. This value is generally used in actual convexity and duration methods.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
Implements com::ftlabs::fisa::calc::Calculator.
| virtual double com::ftlabs::fisa::calc::LastPeriodCalculator::calculatePriceValue1BP | ( | double | price, | |
| double | yield | |||
| ) | const throw ( CalculationException ) [virtual] |
Calculate the average price value obtained by varying the yield up and down one basis point.
Implements com::ftlabs::fisa::calc::Calculator.
Reimplemented in com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateYieldValue1_32 | ( | double | pv1b | ) | const throw ( CalculationException ) [virtual] |
Calculate the average yield value obtained by varying the price up and down 1/32.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. |
Implements com::ftlabs::fisa::calc::Calculator.
| virtual double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateEstimatedMacaulayDuration | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( CalculationException ) [virtual] |
Calculate an estimated Macaulay duration.
This is usually faster than the actual Macaulay duration method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
Reimplemented in com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateEstimatedModifiedDuration | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( CalculationException ) [virtual] |
Calculate an estimated modified duration.
This is usually faster than the actual modified duration method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
| virtual double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateEstimatedModifiedDuration | ( | double | duration, | |
| double | yield | |||
| ) | const throw ( CalculationException ) [virtual] |
Calculate the estimated modified duration.
| duration | an estimated Macaulay Duration as returned from calculateEstimatedMacaulayDuration. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
Reimplemented in com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator.
| virtual double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateEstimatedConvexity | ( | double | pv1b, | |
| double | price, | |||
| double | yield | |||
| ) | const throw ( CalculationException ) [virtual] |
Calculate an estimated convexity.
This is usually faster than the actual convexity method.
| pv1b | The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method. | |
| price | the price. | |
| yield | the yield. |
Implements com::ftlabs::fisa::calc::Calculator.
Reimplemented in com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator.
| double com::ftlabs::fisa::calc::LastPeriodCalculator::calculateAccruedIncome | ( | const FISADate & | salesDate | ) | const throw ( CalculationException ) [virtual] |
Calculates the accrued interest income to the supplied salesDate.
| salesDate | The projected or actual sales date. |
Reimplemented from com::ftlabs::fisa::calc::OneCashFlowCalculator.
double com::ftlabs::fisa::calc::LastPeriodCalculator::aif [protected] |
double com::ftlabs::fisa::calc::LastPeriodCalculator::df [protected] |
double com::ftlabs::fisa::calc::LastPeriodCalculator::lcf [protected] |
double com::ftlabs::fisa::calc::LastPeriodCalculator::act_df [protected] |
double com::ftlabs::fisa::calc::LastPeriodCalculator::ty_df [protected] |
const DayCountBasis* com::ftlabs::fisa::calc::LastPeriodCalculator::dayCountBasis [protected] |
double com::ftlabs::fisa::calc::LastPeriodCalculator::interestRate [protected] |
Reimplemented in com::ftlabs::fisa::calc::CDLastPeriodCalculator.
bool com::ftlabs::fisa::calc::LastPeriodCalculator::eomAdjust [protected] |
1.5.2