com::ftlabs::fisa::calc::InterestAtMaturityCalculator Class Reference

#include <InterestAtMaturityCalculator.h>

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

com::ftlabs::fisa::calc::OneCashFlowCalculator com::ftlabs::fisa::calc::AbstractCalculator com::ftlabs::fisa::calc::Calculator com::ftlabs::fisa::calc::YieldConvergable List of all members.

Public Member Functions

 InterestAtMaturityCalculator (const FISADate &settlementDate, const Redemption &redemption, const double parValue, const double interestRate, const DayCountBasis &dayCountBasis, const bool eomAdjust, const FISADate &datedDate, const HolidaySchedule *holidaySchedule) throw ( com::ftlabs::fisa::calc::CalculationException )
 InterestAtMaturityCalculator (const InterestAtMaturityCalculator &calculator)
InterestAtMaturityCalculatoroperator= (const InterestAtMaturityCalculator &calculator)
 ~InterestAtMaturityCalculator (void)
void setValues (const FISADate &settlementDate, const Redemption &redemption, const double parValue, const double interestRate, const DayCountBasis &dayCountBasis, const bool eomAdjust, const FISADate &datedDate, const HolidaySchedule *holidaySchedule) throw ( com::ftlabs::fisa::calc::CalculationException )
double calculateCurrentYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate current yield for the given price.
double calculateYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate yield for the given price.
double calculatePrice (double yield) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate price for the given yield.
double calculateAccruedInterest () const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate the accrued interest to the settlement date.
double getInterest (int cashFlowIndex) const
 Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex.
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.
double calculatePriceValue1BP (double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate the average price value obtained by varying the yield up and down one basis point.
double calculateYieldValue1_32 (double pv1b) const throw ( com::ftlabs::fisa::calc::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 ( com::ftlabs::fisa::calc::CalculationException )
 Calculate an estimated Macaulay duration.
double calculateEstimatedModifiedDuration (double pv1b, double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate an estimated modified duration.
double calculateEstimatedModifiedDuration (double duration, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate the estimated modified duration.
double calculateEstimatedConvexity (double pv1b, double price, double yield) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate an estimated convexity.
double calculateTrueYield (double price) const throw ( com::ftlabs::fisa::calc::CalculationException )
 Calculate a True Yield, using adjusting cashflows that fall on business days.
virtual Calculatorclone (void) const

Private Attributes

double interestRate
double taxAdjustedInterestRate
double taxAdjustedRedemptionValue
double aif
double df
double lcf
double periodicTTF
double ty_df

Constructor & Destructor Documentation

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

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

com::ftlabs::fisa::calc::InterestAtMaturityCalculator::~InterestAtMaturityCalculator ( void   ) 


Member Function Documentation

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

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

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::calculateCurrentYield ( double  price  )  const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateYield ( double  price  )  const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculatePrice ( double  yield  )  const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateAccruedInterest (  )  const throw ( com::ftlabs::fisa::calc::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.

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

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::calculatePriceValue1BP ( double  price,
double  yield 
) const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateYieldValue1_32 ( double  pv1b  )  const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateEstimatedMacaulayDuration ( double  pv1b,
double  price,
double  yield 
) const throw ( com::ftlabs::fisa::calc::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.

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::calculateEstimatedModifiedDuration ( double  pv1b,
double  price,
double  yield 
) const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateEstimatedModifiedDuration ( double  duration,
double  yield 
) const throw ( com::ftlabs::fisa::calc::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.

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::calculateEstimatedConvexity ( double  pv1b,
double  price,
double  yield 
) const throw ( com::ftlabs::fisa::calc::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::InterestAtMaturityCalculator::calculateTrueYield ( double  price  )  const throw ( com::ftlabs::fisa::calc::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::OneCashFlowCalculator.

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

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


Member Data Documentation

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

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

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

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::aif [private]

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::df [private]

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::lcf [private]

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::periodicTTF [private]

double com::ftlabs::fisa::calc::InterestAtMaturityCalculator::ty_df [private]


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