|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ftlabs.fisa.calc.PreferredCalculator
public class PreferredCalculator
An abstract calculator implementation that includes calculation methods that are specific to Preferred securities.
| Constructor Summary | |
|---|---|
protected |
PreferredCalculator()
Creates a new PreferredCalculator. |
protected |
PreferredCalculator(FISADate tradeDate,
double parValue,
double interestRate,
InterestFrequency interestFrequency,
DayCountBasis dayCountBasis,
boolean eomAdjust,
FISADate datedDate,
FISADate exDividendDate)
Creates a new PreferredCalculator. |
| Method Summary | |
|---|---|
Analytics |
calculate(AnalyticValueType givenType,
double givenValue)
Calculate an Analytics object using the provided
AnalyticValueType and value. |
double |
calculateAccruedDividend()
Calculates the accrued dividend. |
double |
calculateAccruedInterest()
Always returns 0.0 for Preferred securites. |
double |
calculateAnnualDividend()
Calculates the annual dividend. |
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 |
calculateStripPrice(double price)
Calculates the strip price given the calculated "dirty" price. |
double |
calculateStripYield(double price)
Calculates the strip yield given the calculated "dirty" price. |
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 price)
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. |
protected Calculator |
getDelegate()
|
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. |
protected void |
setDelegate(Calculator _delegate)
|
protected void |
setValues(FISADate tradeDate,
double parValue,
double interestRate,
InterestFrequency interestFrequency,
DayCountBasis dayCountBasis,
boolean eomAdjust,
FISADate datedDate,
FISADate exDividendDate)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PreferredCalculator()
protected PreferredCalculator(FISADate tradeDate,
double parValue,
double interestRate,
InterestFrequency interestFrequency,
DayCountBasis dayCountBasis,
boolean eomAdjust,
FISADate datedDate,
FISADate exDividendDate)
throws CalculationException
CalculationException| Method Detail |
|---|
protected void setValues(FISADate tradeDate,
double parValue,
double interestRate,
InterestFrequency interestFrequency,
DayCountBasis dayCountBasis,
boolean eomAdjust,
FISADate datedDate,
FISADate exDividendDate)
throws CalculationException
CalculationException
public double calculateAccruedDividend()
throws CalculationException
CalculationException
public double calculateStripPrice(double price)
throws CalculationException
price - The calculated "dirty" price.
CalculationException
public double calculateStripYield(double price)
throws CalculationException
price - The calculated "dirty" price.
CalculationException
public double calculateAnnualDividend()
throws CalculationException
CalculationExceptionpublic double calculateAccruedInterest()
calculateAccruedInterest in interface Calculatorprotected void setDelegate(Calculator _delegate)
protected Calculator getDelegate()
public FISADate getSettlementDate()
Calculator
getSettlementDate in interface Calculatorpublic Redemption getRedemption()
CalculatorRedemption to which this Calculator is bound.
getRedemption in interface Calculator
public double calculatePrice(double yield)
throws CalculationException
Calculator
calculatePrice in interface CalculatorcalculatePrice in interface YieldConvergableyield - yield
CalculationException
public double calculateYield(double price)
throws CalculationException
Calculator
calculateYield in interface Calculatorprice - price
CalculationException
public double calculateCurrentYield(double price)
throws CalculationException
Calculator
calculateCurrentYield in interface Calculatorprice - price
CalculationExceptionpublic int getCashFlowCount()
CalculatorRedemption period.
getCashFlowCount in interface CalculatorRedemption period.
public double calculatePeriodicYield(double price)
throws CalculationException
Calculator
calculatePeriodicYield in interface Calculatorprice - the price.
CalculationException
public double calculateMacaulayDuration(double periodicYield)
throws CalculationException
Calculator
calculateMacaulayDuration in interface CalculatorperiodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
public double calculateModifiedDuration(double periodicYield)
throws CalculationException
Calculator
calculateModifiedDuration in interface CalculatorperiodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
public double calculateConvexity(double periodicYield)
throws CalculationException
Calculator
calculateConvexity in interface CalculatorperiodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
public double calculateYieldValue1_32(double price)
throws CalculationException
Calculator
calculateYieldValue1_32 in interface Calculatorprice - The average price value obtained by varying the yield up
and down one basis point, as returned by the calculatePriceValue1BP
method.
CalculationException
public Analytics calculate(AnalyticValueType givenType,
double givenValue)
throws CalculationException
CalculatorAnalytics object using the provided
AnalyticValueType and value.
calculate in interface CalculatorgivenType - The AnalyticValueType of the givenValue.givenValue - The value to calculate the Analytics from.
CalculationExceptionpublic double getInterest(int cashFlowIndex)
Calculator
getInterest in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public double getPrincipal(int cashFlowIndex)
Calculator
getPrincipal in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public double getTotalCashFlow(int cashFlowIndex)
Calculator
getTotalCashFlow in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public double getTimeToFlow(int cashFlowIndex)
Calculator
getTimeToFlow in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public double getPeriodicTimeToFlow(int cashFlowIndex)
Calculator
getPeriodicTimeToFlow in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public FISADate getCashFlowDate(int cashFlowIndex)
Calculator
getCashFlowDate in interface CalculatorcashFlowIndex - The cashflow index. cashFlowIndex is zero based
and must be a number from 0 to getCashFlowCount() - 1.
public void getCashFlowDate(int cashFlowIndex,
FISADate date)
Calculator
getCashFlowDate in interface CalculatorcashFlowIndex - 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.
public double calculateModifiedDuration(double macaulayDuration,
double periodicYield)
throws CalculationException
Calculator
calculateModifiedDuration in interface CalculatormacaulayDuration - The Macaulay Duration as calculated by the
calculateMacaulayDuration method.periodicYield - The periodicYield as returned from the
calculatePeriodicYield method.
CalculationException
public double calculatePriceValue1BP(double price,
double yield)
throws CalculationException
Calculator
calculatePriceValue1BP in interface CalculatorCalculationException
public double calculateEstimatedMacaulayDuration(double pv1b,
double price,
double yield)
throws CalculationException
Calculator
calculateEstimatedMacaulayDuration in interface Calculatorpv1b - 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
public double calculateEstimatedModifiedDuration(double pv1b,
double price,
double yield)
throws CalculationException
Calculator
calculateEstimatedModifiedDuration in interface Calculatorpv1b - 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
public double calculateEstimatedModifiedDuration(double duration,
double yield)
throws CalculationException
Calculator
calculateEstimatedModifiedDuration in interface Calculatorduration - the estimated Macaulay Duration.yield - the yield.
CalculationException
public double calculateEstimatedConvexity(double pv1b,
double price,
double yield)
throws CalculationException
Calculator
calculateEstimatedConvexity in interface Calculatorpv1b - 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
public double calculateTotalInterestFlows()
throws CalculationException
Calculator
calculateTotalInterestFlows in interface CalculatorCalculationException
public double calculateInterestOnInterest(double reinvestmentYield)
throws CalculationException
Calculator
calculateInterestOnInterest in interface CalculatorreinvestmentYield - 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 | |||||||||