com::ftlabs::fisa::calc::LastPeriodCalculator Class Reference

#include <LastPeriodCalculator.h>

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

com::ftlabs::fisa::calc::OneCashFlowCalculator com::ftlabs::fisa::calc::AbstractCalculator com::ftlabs::fisa::calc::Calculator com::ftlabs::fisa::calc::YieldConvergable com::ftlabs::fisa::calc::CDLastPeriodCalculator com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator com::ftlabs::fisa::calc::LastPeriodSimpleInterestCalculator com::ftlabs::fisa::calc::MSRBOneLongPeriodCalculator com::ftlabs::fisa::calc::MSRBOneShortPeriodCalculator List of all members.

Public Member Functions

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 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 )
LastPeriodCalculatoroperator= (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 DayCountBasisdayCountBasis
double interestRate
bool eomAdjust
FISADate interestAccrualDate

Constructor & Destructor Documentation

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]


Member Function Documentation

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]

Reimplemented in com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator, and com::ftlabs::fisa::calc::LastPeriodSimpleInterestCalculator.

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.

Returns:
The date on which interest begins to accrue.

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.

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

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.

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.

Returns:
the average price value obtained by varying the yield up and down one basis point.

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

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.

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.

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.

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

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.

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

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.

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 convexity.

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

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.

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

Reimplemented from com::ftlabs::fisa::calc::OneCashFlowCalculator.


Member Data Documentation

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]

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


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