com::ftlabs::fisa::calc::CDFixedInterestRateCalculator Class Reference

#include <CDFixedInterestRateCalculator.h>

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

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 List of all members.

Public Member Functions

 CDFixedInterestRateCalculator (const FISADate &settlementDate, const Redemption &redemption, const double parValue, const double interestRate, const DayCountBasis &dayCountBasis, const int interestFrequency, const bool eomAdjust, const FISADate *datedDate, const FISADate *firstInterestDate, const HolidaySchedule *holidaySchedule) throw ( CalculationException )
 CDFixedInterestRateCalculator (const CDFixedInterestRateCalculator &calculator)
virtual ~CDFixedInterestRateCalculator (void)
CDFixedInterestRateCalculatoroperator= (const CDFixedInterestRateCalculator &calculator)
void setValues (const FISADate &settlementDate, const Redemption &redemption, const double parValue, const double interestRate, const DayCountBasis &dayCountBasis, const int interestFrequency, const bool eomAdjust, const FISADate *datedDate, const FISADate *firstInterestDate, const HolidaySchedule *holidaySchedule) throw ( CalculationException )
double calculateCurrentYield (double price) const throw ( CalculationException )
 Calculate current yield for the given price.
double calculateYield (double price) const throw ( CalculationException )
 Calculate yield for the given price.
double calculatePrice (double yield) const throw ( CalculationException )
 Calculate price for the given yield.
double calculateAccruedInterest () const throw ( CalculationException )
 Calculate the accrued interest to the settlement date.
int getCashFlowCount () const
 Get the number of cashflows within the bounding settlement to Redemption period.
double getInterest (int cashFlowIndex) const
 Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex.
double calculatePeriodicYield (double price) const throw ( CalculationException )
 Calculate a periodic discounted cash flow yield for use with convexity/duration methods.
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 calculateEstimatedConvexity (double pv1b, double price, double yield) const throw ( CalculationException )
 Calculate an estimated convexity.
double calculateTrueYield (double price) const throw ( CalculationException )
 Calculate a True Yield, using adjusting cashflows that fall on business days.
virtual Calculatorclone (void) const

Protected Member Functions

 CDFixedInterestRateCalculator (void)

Private Attributes

double interestRate
double * yearFractions
double remainingYearFraction
int cashFlowCount
double taxAdjustedInterestRate
double taxAdjustedRedemptionValue
PeriodicYieldConvergableperiodicYieldConvergable
CDTrueYieldConvergable ** trueYieldConvergable
const HolidayScheduleholidaySchedule
const DayCountBasisdayCountBasis
FISADate interestAccrualDate

Constructor & Destructor Documentation

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

com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::CDFixedInterestRateCalculator ( const FISADate settlementDate,
const Redemption redemption,
const double  parValue,
const double  interestRate,
const DayCountBasis dayCountBasis,
const int  interestFrequency,
const bool  eomAdjust,
const FISADate datedDate,
const FISADate firstInterestDate,
const HolidaySchedule holidaySchedule 
) throw ( CalculationException )

com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::CDFixedInterestRateCalculator ( const CDFixedInterestRateCalculator calculator  ) 

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


Member Function Documentation

CDFixedInterestRateCalculator& com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::operator= ( const CDFixedInterestRateCalculator calculator  ) 

void com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::setValues ( const FISADate settlementDate,
const Redemption redemption,
const double  parValue,
const double  interestRate,
const DayCountBasis dayCountBasis,
const int  interestFrequency,
const bool  eomAdjust,
const FISADate datedDate,
const FISADate firstInterestDate,
const HolidaySchedule holidaySchedule 
) throw ( CalculationException )

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculateCurrentYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate current yield for the given price.

Parameters:
price a price
Returns:
current yield as calculated for the given price.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculateYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate yield for the given price.

Parameters:
price a price
Returns:
yield as calculated for the given price.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculatePrice ( double  yield  )  const throw ( CalculationException ) [virtual]

Calculate price for the given yield.

Parameters:
yield a yield
Returns:
price as calculated for the given yield.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculateAccruedInterest (  )  const throw ( CalculationException ) [virtual]

Calculate the accrued interest to the settlement date.

Returns:
The accrued interest to the settlement date.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

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

int com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::getCashFlowCount (  )  const [virtual]

Get the number of cashflows within the bounding settlement to Redemption period.

Returns:
The number of cashflows within the supported settlement to Redemption period.

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::getInterest ( int  cashFlowIndex  )  const [virtual]

Get the 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 interest to be paid for the specified cashflow.

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculatePeriodicYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate a periodic discounted cash flow yield for use with convexity/duration methods.

Parameters:
price the price.
Returns:
Periodic discounted cash flow yield.

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

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

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

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::calculateTrueYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate a True Yield, using adjusting cashflows that fall on business days.

Cashflow dates are adjusted according to a provided HolidaySchedule and/or weekend days.

Parameters:
price the clean price.
Returns:
The true yield using adjusted cashflows that fall on business days.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

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

virtual Calculator* com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::clone ( void   )  const [virtual]

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


Member Data Documentation

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::interestRate [private]

double* com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::yearFractions [private]

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::remainingYearFraction [private]

int com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::cashFlowCount [private]

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::taxAdjustedInterestRate [private]

double com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::taxAdjustedRedemptionValue [private]

PeriodicYieldConvergable* com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::periodicYieldConvergable [private]

CDTrueYieldConvergable** com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::trueYieldConvergable [private]

const HolidaySchedule* com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::holidaySchedule [private]

const DayCountBasis* com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::dayCountBasis [private]

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

FISADate com::ftlabs::fisa::calc::CDFixedInterestRateCalculator::interestAccrualDate [private]

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


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