com::ftlabs::fisa::calc::MultiplePeriodCalculator Class Reference

#include <MultiplePeriodCalculator.h>

Inheritance diagram for com::ftlabs::fisa::calc::MultiplePeriodCalculator:

com::ftlabs::fisa::calc::MultipleCashFlowCalculator com::ftlabs::fisa::calc::AbstractCalculator com::ftlabs::fisa::calc::Calculator com::ftlabs::fisa::calc::YieldConvergable com::ftlabs::fisa::calc::CDFixedInterestRateCalculator com::ftlabs::fisa::calc::FixedInterestRateCalculator com::ftlabs::fisa::calc::JapaneseCalculator com::ftlabs::fisa::calc::SteppedCouponCalculator com::ftlabs::fisa::calc::FirstPeriodSimpleInterestCalculator com::ftlabs::fisa::calc::MSRBFixedInterestRateCalculator com::ftlabs::fisa::calc::SimpleYTRMultiplePeriodCalculator com::ftlabs::fisa::calc::CDSteppedCouponCalculator com::ftlabs::fisa::calc::SteppedCouponCompoundingCalculator com::ftlabs::fisa::calc::MSRBSteppedCouponCalculator List of all members.

Public Member Functions

virtual ~MultiplePeriodCalculator (void)
const FISADategetSettlementDate () const
 Get the settlement date to which this Calculator is bound.
const RedemptiongetRedemption () const
 Get the Redemption to which this Calculator is bound.
const FISADategetInterestAccrualDate (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 getTotalCashFlow (int cashFlowIndex) const
 Get the principal and interest 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.
FISADate getCashFlowDate (int cashFlowIndex) const
 Get a cash flow date for a particular cashflow, as specified by the provided cashFlowIndex.
void getCashFlowDate (int cashFlowIndex, FISADate &date) const
 Set the provided FISADate to the cash flow date of a particular cashflow, as specified by the provided cashFlowIndex.
double calculateYieldValue1_32 (double pv1b) const throw ( CalculationException )
 Calculate the average yield value obtained by varying the price up and down 1/32.
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.
double calculateEstimatedModifiedDuration (double duration, double yield) const throw ( CalculationException )
 Calculate the estimated modified duration.
virtual double calculateAccruedIncome (const FISADate &salesDate) const throw ( CalculationException )
 Calculates the accrued interest income to the supplied salesDate.
virtual double calculateInterestOnInterest (double reinvestmentYield) const throw ( CalculationException )
 Calculate the interest earned on reinvested interest cashflows using the provided reinvestmentYield.

Protected Member Functions

 MultiplePeriodCalculator (void)
 MultiplePeriodCalculator (const FISADate &settlementDate, const FISADate *exDividendDate, const Redemption &redemption, double parValue, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, const FISADate *datedDate, const FISADate *firstInterestDate) throw ( CalculationException )
 MultiplePeriodCalculator (const MultiplePeriodCalculator &calculator)
MultiplePeriodCalculatoroperator= (const MultiplePeriodCalculator &calculator)
void setValues (const FISADate &settlementDate, const FISADate *exDividendDate, const Redemption &redemption, double parValue, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, const FISADate *datedDate, const FISADate *firstInterestDate) throw ( CalculationException )

Protected Attributes

FISADate settlementDate
Redemption redemption
FISADate interestAccrualDate
FISADate nextCouponDate
double parValue
bool eomAdjust
const DayCountBasisdayCountBasis
double aif
double fcf
double df
double lcf
double ldf
double act_df
double act_ldf

Private Types

typedef const std::map< FISADate,
double > 
partial_payments_map

Private Member Functions

void calculateNormalFirstPeriodFactors (const FISADate &prevDate, const FISADate &nextDate, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, bool tradingExDividend)
void calculateShortFirstPeriodFactors (const FISADate &quasiDatedDate, const FISADate &datedDate, const FISADate &firstInterestDate, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, bool tradingExDividend)
void calculateLongFirstPeriodFactors (CouponDateGenerator &couponDates, const FISADate &datedDate, const FISADate &firstInterestDate, const DayCountBasis &dayCountBasis, int interestFrequency, bool eomAdjust, bool tradingExDividend)

Member Typedef Documentation

typedef const std::map<FISADate, double> com::ftlabs::fisa::calc::MultiplePeriodCalculator::partial_payments_map [private]


Constructor & Destructor Documentation

com::ftlabs::fisa::calc::MultiplePeriodCalculator::MultiplePeriodCalculator ( void   )  [protected]

com::ftlabs::fisa::calc::MultiplePeriodCalculator::MultiplePeriodCalculator ( const FISADate settlementDate,
const FISADate exDividendDate,
const Redemption redemption,
double  parValue,
const DayCountBasis dayCountBasis,
int  interestFrequency,
bool  eomAdjust,
const FISADate datedDate,
const FISADate firstInterestDate 
) throw ( CalculationException ) [protected]

com::ftlabs::fisa::calc::MultiplePeriodCalculator::MultiplePeriodCalculator ( const MultiplePeriodCalculator calculator  )  [protected]

virtual com::ftlabs::fisa::calc::MultiplePeriodCalculator::~MultiplePeriodCalculator ( void   )  [virtual]


Member Function Documentation

MultiplePeriodCalculator& com::ftlabs::fisa::calc::MultiplePeriodCalculator::operator= ( const MultiplePeriodCalculator calculator  )  [protected]

void com::ftlabs::fisa::calc::MultiplePeriodCalculator::setValues ( const FISADate settlementDate,
const FISADate exDividendDate,
const Redemption redemption,
double  parValue,
const DayCountBasis dayCountBasis,
int  interestFrequency,
bool  eomAdjust,
const FISADate datedDate,
const FISADate firstInterestDate 
) throw ( CalculationException ) [protected]

const FISADate& com::ftlabs::fisa::calc::MultiplePeriodCalculator::getSettlementDate (  )  const [virtual]

Get the settlement date to which this Calculator is bound.

Returns:
Settlement date.

Implements com::ftlabs::fisa::calc::Calculator.

const Redemption& com::ftlabs::fisa::calc::MultiplePeriodCalculator::getRedemption (  )  const [virtual]

Get the Redemption to which this Calculator is bound.

Returns:
Redemption.

Implements com::ftlabs::fisa::calc::Calculator.

const FISADate* com::ftlabs::fisa::calc::MultiplePeriodCalculator::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.

Returns:
The date on which interest begins to accrue.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::getPrincipal ( int  cashFlowIndex  )  const [virtual]

Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.

Returns:
The principal to be paid for the specified cashflow.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::getTotalCashFlow ( int  cashFlowIndex  )  const [virtual]

Get the principal and interest to be paid for a particular cashflow, as specified by cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.

Returns:
The principal + interest to be paid for the specified cashflow.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::getTimeToFlow ( int  cashFlowIndex  )  const [virtual]

Get the time to flow for a particular cashflow, as specified by cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.

Returns:
The time to flow for the specified cashflow.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::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.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.
Returns:
The periodic time to flow as calculated with an actual day count method for the specified cashflow.

Implements com::ftlabs::fisa::calc::Calculator.

FISADate com::ftlabs::fisa::calc::MultiplePeriodCalculator::getCashFlowDate ( int  cashFlowIndex  )  const [virtual]

Get a cash flow date for a particular cashflow, as specified by the provided cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.
Returns:
The cash flow date for the provided cash flow index.

Implements com::ftlabs::fisa::calc::Calculator.

void com::ftlabs::fisa::calc::MultiplePeriodCalculator::getCashFlowDate ( int  cashFlowIndex,
FISADate date 
) const [virtual]

Set the provided FISADate to the cash flow date of a particular cashflow, as specified by the provided cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.
date A reference to a FISADate to be set to the specified cash flow date.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateYieldValue1_32 ( double  pv1b  )  const throw ( CalculationException ) [virtual]

Calculate the average yield value obtained by varying the price up and down 1/32.

Parameters:
pv1b The average price value obtained by varying the yield up and down one basis point, as returned by the calculatePriceValue1BP method.

Returns:
the average yield value obtained by varying the price up and down 1/32.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::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.

Parameters:
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.

Returns:
an estimated Macaulay duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

Reimplemented in com::ftlabs::fisa::calc::JapaneseCalculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::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.

Parameters:
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.

Returns:
an estimated modified duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateEstimatedModifiedDuration ( double  duration,
double  yield 
) const throw ( CalculationException ) [virtual]

Calculate the estimated modified duration.

Parameters:
duration an estimated Macaulay Duration as returned from calculateEstimatedMacaulayDuration.
yield the yield.

Returns:
estimated modified duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

virtual double com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateAccruedIncome ( const FISADate salesDate  )  const throw ( CalculationException ) [virtual]

Calculates the accrued interest income to the supplied salesDate.

Parameters:
salesDate The projected or actual sales date.
Returns:
The accrued interest income to the supplied salesDate.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

Reimplemented in com::ftlabs::fisa::calc::FixedInterestRateCalculator, and com::ftlabs::fisa::calc::SteppedCouponCalculator.

virtual double com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateInterestOnInterest ( double  reinvestmentYield  )  const throw ( CalculationException ) [virtual]

Calculate the interest earned on reinvested interest cashflows using the provided reinvestmentYield.

Parameters:
reinvestmentYield The assumed yield of the reinvested interest cashflows.
Returns:
The interest earned on reinvested interest cashflows.

Implements com::ftlabs::fisa::calc::Calculator.

void com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateNormalFirstPeriodFactors ( const FISADate prevDate,
const FISADate nextDate,
const DayCountBasis dayCountBasis,
int  interestFrequency,
bool  eomAdjust,
bool  tradingExDividend 
) [private]

void com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateShortFirstPeriodFactors ( const FISADate quasiDatedDate,
const FISADate datedDate,
const FISADate firstInterestDate,
const DayCountBasis dayCountBasis,
int  interestFrequency,
bool  eomAdjust,
bool  tradingExDividend 
) [private]

void com::ftlabs::fisa::calc::MultiplePeriodCalculator::calculateLongFirstPeriodFactors ( CouponDateGenerator couponDates,
const FISADate datedDate,
const FISADate firstInterestDate,
const DayCountBasis dayCountBasis,
int  interestFrequency,
bool  eomAdjust,
bool  tradingExDividend 
) [private]


Member Data Documentation

FISADate com::ftlabs::fisa::calc::MultiplePeriodCalculator::settlementDate [protected]

Redemption com::ftlabs::fisa::calc::MultiplePeriodCalculator::redemption [protected]

FISADate com::ftlabs::fisa::calc::MultiplePeriodCalculator::interestAccrualDate [protected]

Reimplemented in com::ftlabs::fisa::calc::CDFixedInterestRateCalculator, and com::ftlabs::fisa::calc::CDSteppedCouponCalculator.

FISADate com::ftlabs::fisa::calc::MultiplePeriodCalculator::nextCouponDate [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::parValue [protected]

bool com::ftlabs::fisa::calc::MultiplePeriodCalculator::eomAdjust [protected]

const DayCountBasis* com::ftlabs::fisa::calc::MultiplePeriodCalculator::dayCountBasis [protected]

Reimplemented in com::ftlabs::fisa::calc::CDFixedInterestRateCalculator, com::ftlabs::fisa::calc::CDSteppedCouponCalculator, com::ftlabs::fisa::calc::JapaneseCalculator, and com::ftlabs::fisa::calc::SteppedCouponCompoundingCalculator.

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::aif [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::fcf [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::df [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::lcf [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::ldf [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::act_df [protected]

double com::ftlabs::fisa::calc::MultiplePeriodCalculator::act_ldf [protected]


The documentation for this class was generated from the following file:
Generated on Tue Feb 5 03:50:38 2008 for FTLabs FISA (c++) by  doxygen 1.5.2