|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Calculator
This interface provides calculation methods that are tuned specifically for
the implemented security and for a particular settlement to Redemption
period.
| Method Summary | |
|---|---|
Analytics |
calculate(AnalyticValueType givenType,
double givenValue)
Calculate an Analytics object using the provided
AnalyticValueType and value. |
double |
calculateAccruedInterest()
Calculate the accrued interest to the settlement date. |
double |
calculateConvexity(double periodicYield)
Calculate the actual convexity. |
double |
calculateCurrentYield(double price)
Calculate current yield for the given price. |
double |
calculateEstimatedConvexity(double pv1b,
double price,
double yield)
Calculate the estimated convexity. |
double |
calculateEstimatedMacaulayDuration(double pv1b,
double price,
double yield)
Calculate the estimated Macaulay duration. |
double |
calculateEstimatedModifiedDuration(double duration,
double yield)
Calculate the estimated modified duration. |
double |
calculateEstimatedModifiedDuration(double pv1b,
double price,
double yield)
Calculate the estimated modified duration. |
double |
calculateInterestOnInterest(double reinvestmentYield)
Calculate the interest earned on reinvested interest cashflows using the provided reinvestmentYield. |
double |
calculateMacaulayDuration(double periodicYield)
Calculate the actual Macaulay duration. |
double |
calculateModifiedDuration(double periodicYield)
Calculate the actual modified duration. |
double |
calculateModifiedDuration(double macaulayDuration,
double periodicYield)
Calculate the actual modified duration using an already calculated Macaulay Duration. |
double |
calculatePeriodicYield(double price)
Calculate a periodic discounted cash flow yield for use with convexity/duration methods. |
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 |
calculateTotalInterestFlows()
A convenience method to total all interest cashflows between the settlement to redemption period. |
double |
calculateYield(double price)
Calculate yield for the given price. |
double |
calculateYieldValue1_32(double pv1b)
Calculate the average yield value obtained by varying the price up and down 1/32. |
int |
getCashFlowCount()
Get the number of cashflows within the supported settlement to Redemption period. |
FISADate |
getCashFlowDate(int cashFlowIndex)
Get a cash flow date for a particular cashflow, as specified by the provided cashFlowIndex. |
void |
getCashFlowDate(int cashFlowIndex,
FISADate date)
Set the provided FISADate to the cash flow date of a particular cashflow, as specified by the provided cashFlowIndex. |
double |
getInterest(int cashFlowIndex)
Get the interest to be paid for a particular cashflow, as specified by cashFlowIndex. |
double |
getPeriodicTimeToFlow(int cashFlowIndex)
Get the periodic time to flow as calculated with an actual day count method for a particular cashflow, as specified by cashFlowIndex. |
double |
getPrincipal(int cashFlowIndex)
Get the principal to be paid for a particular cashflow, as specified by cashFlowIndex. |
Redemption |
getRedemption()
Get the Redemption to which this Calculator is bound. |
FISADate |
getSettlementDate()
Get the settlement date to which this Calculator is bound. |
double |
getTimeToFlow(int cashFlowIndex)
Get the time to flow for a particular cashflow, as specified by cashFlowIndex. |
double |
getTotalCashFlow(int cashFlowIndex)
Get the principal and interest to be paid for a particular cashflow, as specified by cashFlowIndex. |
| Method Detail |
|---|
FISADate getSettlementDate()
Redemption getRedemption()
Redemption to which this Calculator is bound.
double calculateYield(double price)
throws CalculationException
price - price
CalculationException
double calculateCurrentYield(double price)
throws CalculationException
price - price
CalculationException
double calculatePrice(double yield)
throws CalculationException
calculatePrice in interface YieldConvergableyield - yield
CalculationException
double calculateAccruedInterest()
throws CalculationException
CalculationExceptionint getCashFlowCount()
Redemption period.
Redemption period.double getInterest(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.double getPrincipal(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.double getTotalCashFlow(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.double getTimeToFlow(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.double getPeriodicTimeToFlow(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.FISADate getCashFlowDate(int cashFlowIndex)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.
void getCashFlowDate(int cashFlowIndex,
FISADate date)
cashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.date - A FISADate to be set to the specified cash flow date.
java.lang.ArrayIndexOutOfBoundsException - If cashFlowIndex is less
than zero or cashFlowIndex is greater than getCashFlowCount() - 1.
double calculatePeriodicYield(double price)
throws CalculationException
price - the price.
CalculationException
double calculateMacaulayDuration(double periodicYield)
throws CalculationException
periodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
double calculateModifiedDuration(double periodicYield)
throws CalculationException
periodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
double calculateModifiedDuration(double macaulayDuration,
double periodicYield)
throws CalculationException
macaulayDuration - The Macaulay Duration as calculated by the
calculateMacaulayDuration method.periodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
double calculateConvexity(double periodicYield)
throws CalculationException
periodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
double calculatePriceValue1BP(double price,
double yield)
throws CalculationException
CalculationException
double calculateYieldValue1_32(double pv1b)
throws CalculationException
pv1b - The average price value obtained by varying the yield up
and down one basis point, as returned by the calculatePriceValue1BP
method.
CalculationException
double calculateEstimatedMacaulayDuration(double pv1b,
double price,
double yield)
throws CalculationException
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.
CalculationException
double calculateEstimatedModifiedDuration(double pv1b,
double price,
double yield)
throws CalculationException
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.
CalculationException
double calculateEstimatedModifiedDuration(double duration,
double yield)
throws CalculationException
duration - the estimated Macaulay Duration.yield - the yield.
CalculationException
double calculateEstimatedConvexity(double pv1b,
double price,
double yield)
throws CalculationException
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.
CalculationException
Analytics calculate(AnalyticValueType givenType,
double givenValue)
throws CalculationException
Analytics object using the provided
AnalyticValueType and value.
givenType - The AnalyticValueType of the givenValue.givenValue - The value to calculate the Analytics from.
com.ftlabs.fis.calc.CalculationException
CalculationException
double calculateTotalInterestFlows()
throws CalculationException
CalculationException
double calculateInterestOnInterest(double reinvestmentYield)
throws CalculationException
reinvestmentYield - The assumed yield of the reinvested interest
cashflows.
CalculationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||