com.ftlabs.fisa.calc
Class SteppedCouponCompoundingCalculator

java.lang.Object
  extended by com.ftlabs.fisa.calc.AbstractCalculator
      extended by com.ftlabs.fisa.calc.MultipleCashFlowCalculator
          extended by com.ftlabs.fisa.calc.MultiplePeriodCalculator
              extended by com.ftlabs.fisa.calc.SteppedCouponCalculator
                  extended by com.ftlabs.fisa.calc.SteppedCouponCompoundingCalculator
All Implemented Interfaces:
Calculator, YieldConvergable, java.io.Serializable
Direct Known Subclasses:
MSRBSteppedCouponCalculator

public class SteppedCouponCompoundingCalculator
extends SteppedCouponCalculator

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ftlabs.fisa.calc.SteppedCouponCalculator
interestRates, interestTaxRate, taxAdjustedRedemptionValue
 
Fields inherited from class com.ftlabs.fisa.calc.MultiplePeriodCalculator
act_df, act_ldf, aif, df, fcf, lcf, ldf
 
Fields inherited from class com.ftlabs.fisa.calc.MultipleCashFlowCalculator
eomAdjust, interestFrequency, nextCouponDate, parValue, redemption, settlementDate
 
Constructor Summary
protected SteppedCouponCompoundingCalculator()
           
  SteppedCouponCompoundingCalculator(FISADate settlementDate, Redemption redemption, double parValue, InterestRateSchedule interestRateSchedule, DayCountBasis dayCountBasis, int interestFrequency, boolean eomAdjust, FISADate datedDate, FISADate firstInterestDate)
           
 
Method Summary
 double calculateAccruedInterest()
          Calculate the accrued interest to the settlement date.
 double calculateEstimatedConvexity(double pv1b, double price, double yield)
          Calculate the estimated convexity.
 double calculatePrice(double yield)
          Calculate price for the given yield.
 double calculatePriceValue1BP(double price, double yield)
          Calculate the average price value obtained by varying the yield up and down one basis point.
 double getInterest(int cashFlowIndex)
          Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex.
static void main(java.lang.String[] args)
           
 void setValues(FISADate settlementDate, Redemption redemption, double parValue, InterestRateSchedule interestRateSchedule, DayCountBasis dayCountBasis, int interestFrequency, boolean eomAdjust, FISADate datedDate, FISADate firstInterestDate)
           
 
Methods inherited from class com.ftlabs.fisa.calc.SteppedCouponCalculator
calculate, calculateCurrentYield, calculatePeriodicYield, calculateYield, getCashFlowCount
 
Methods inherited from class com.ftlabs.fisa.calc.MultiplePeriodCalculator
getPeriodicTimeToFlow, getTimeToFlow, setValues
 
Methods inherited from class com.ftlabs.fisa.calc.MultipleCashFlowCalculator
calculateConvexity, calculateEstimatedMacaulayDuration, calculateEstimatedModifiedDuration, calculateEstimatedModifiedDuration, calculateInterestOnInterest, calculateMacaulayDuration, calculateModifiedDuration, calculateModifiedDuration, calculateYieldValue1_32, getCashFlowDate, getCashFlowDate, getPrincipal, getRedemption, getSettlementDate, getTotalCashFlow, setValues
 
Methods inherited from class com.ftlabs.fisa.calc.AbstractCalculator
calculateApproximateYield, calculateMPCIPrice, calculateSPSIPrice, calculateSPSIYield, calculateTotalInterestFlows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SteppedCouponCompoundingCalculator

protected SteppedCouponCompoundingCalculator()

SteppedCouponCompoundingCalculator

public SteppedCouponCompoundingCalculator(FISADate settlementDate,
                                          Redemption redemption,
                                          double parValue,
                                          InterestRateSchedule interestRateSchedule,
                                          DayCountBasis dayCountBasis,
                                          int interestFrequency,
                                          boolean eomAdjust,
                                          FISADate datedDate,
                                          FISADate firstInterestDate)
                                   throws CalculationException
Throws:
CalculationException
Method Detail

setValues

public void setValues(FISADate settlementDate,
                      Redemption redemption,
                      double parValue,
                      InterestRateSchedule interestRateSchedule,
                      DayCountBasis dayCountBasis,
                      int interestFrequency,
                      boolean eomAdjust,
                      FISADate datedDate,
                      FISADate firstInterestDate)
               throws CalculationException
Overrides:
setValues in class SteppedCouponCalculator
Throws:
CalculationException

calculatePrice

public double calculatePrice(double yield)
                      throws CalculationException
Description copied from interface: Calculator
Calculate price for the given yield.

Parameters:
yield - yield
Returns:
price as calculated for the given yield.
Throws:
CalculationException

calculateAccruedInterest

public double calculateAccruedInterest()
                                throws CalculationException
Description copied from interface: Calculator
Calculate the accrued interest to the settlement date.

Returns:
The accrued interest to the settlement date.
Throws:
CalculationException

getInterest

public double getInterest(int cashFlowIndex)
Description copied from interface: Calculator
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.

calculatePriceValue1BP

public double calculatePriceValue1BP(double price,
                                     double yield)
                              throws CalculationException
Description copied from interface: Calculator
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.
Throws:
CalculationException

calculateEstimatedConvexity

public double calculateEstimatedConvexity(double pv1b,
                                          double price,
                                          double yield)
                                   throws CalculationException
Description copied from interface: Calculator
Calculate the estimated convexity.

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:
estimated convexity.
Throws:
CalculationException

main

public static void main(java.lang.String[] args)