|
WebCab Bonds Demo (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Within this Enterprise JavaBean we provide methods for the evaluation and application of the duration and convexity of a bond. The duration can be thought of the weighted average of the times when payments are made. The convexity is the rate of change with which the duration changes with respect to the underlying price.
The notion of duration pays an important role in the hedging and risk analysis of interest bearing investments. These methods are widely applicable but have the drawback that they assume that the interest rate curve which the asset under consideration depends on may only undergo small parallel shifts. In such an instance the duration pays such an important role because the change in a bonds price will be equal to the duration multiplied by the size of the parallel shift in the yield curve.
The notion of convexity allows us to refine "duration" based methods. In particular, the convexity can be viewed as being the coefficient of the second term within the Taylor expansion of the function which expresses the percentage change in the bonds price with respect to the yield. Hence, whereas the duration measures the linear component of the interest rate risk the convexity measures the two term in the Taylor expansion which is the first non-linear component of the interest rate risk. Therefore, convexity allows us to hedge the most significant component of the nonlinear components of a bonds risk.
| Method Summary | |
double |
bondPriceChange(double duration,
double convexity,
double yieldChange)
Estimates the percentage change of the bond portfolio's value for a given (absolute) change of the yield. |
double |
convexity(double yield,
double[] coupons,
Date evaluationDate,
Date[] dateOfCoupons,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
Evaluates the convexity of a bond. |
double |
convexity(double yield,
double[] coupons,
double[] time2Coupons,
double principleSum,
double maturity)
Evaluates the convexity of a bond. |
double |
duration(double yield,
double[] payments,
Date evaluationDate,
Date[] paymentDates,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
Evaluates the duration of a bond with a continuous interest yield where the cash flows (or payments) made in terms of amount and time of payment are known. |
double |
duration(double yield,
double[] payments,
double[] time2Payments,
double principleSum,
double maturity)
Evaluates the duration of a bond with a continuous interest yield where the cash flows (or payments) made in terms of amount and time of payment are known. |
double |
durationHedgeRatio(double futuresPrice,
double duration,
double forwardValue,
double durationPort)
Evaluates the duration-hedge ratio of an interest rate dependent asset such as a bond portfolio or a money market security. |
double |
durationOfPortfolio(double[] duration,
double[] weightOfBond)
Returns the duration of a portfolio of bonds when the duration and weight of each bond within the portfolio is known. |
double |
durationOfPortfolioValue(double[] duration,
double[] valueOfBond)
Returns the duration (in monetary terms) of a bond portfolio when the duration and value of each bond within the portfolio is known. |
double |
percentagePriceChange(double deltaYield,
double duration)
Returns the percentage change of the bonds price by a small parallel shift of the interest rate curve which the bonds depends on. |
double |
percentagePriceChange(double deltaYield,
double[] duration,
double[] valueOfBond)
Return the percentage change in a bond portfolio's value for a small parallel shift of all the interest rate curves which the bonds within the portfolio depend on. |
double |
percentagePriceChange(double duration,
double annualYield,
double deltaYield)
Evaluates the percentage price change in a bond portfolio's value when the (annual) interest rates (expressed in decimal format) experience a small parallel shift. |
double |
percentagePriceChange(double duration,
double yield,
int periodsCompoundedOver,
double deltaYield)
Evaluates the percentage change in a bond portfolios value when interest rates experience a small parallel shift. |
double |
priceOfBond(double yield,
double[] coupons,
Date evaluationDate,
Date[] dateOfCoupons,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
This method evaluates the price of a bond via the relationship between its yield and cash flows. |
double |
priceOfBond(double yield,
double[] coupons,
double[] time2Coupons,
double principleSum,
double maturity)
This method evaluates the price of a bond via the relationship between its yield and cash flows. |
double[] |
weightOfBonds(double[] valueOfBond)
Evaluates the weights of the individual bonds within a bond portfolio and returns the result as an array of weights where the n-th term of the array corresponds to the weight of the n-th member of the portfolio. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double priceOfBond(double yield,
double[] coupons,
Date evaluationDate,
Date[] dateOfCoupons,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
throws DurationConvexityDemoException,
RemoteException
yield - the continuously compounded yield which the bond pays expressed in decimal format (i.e. 1 percent = 0.01)coupons - an array where the first term is the first coupon payment and the second term is the second coupon payment and so onprincipleSum - the principle sum of the bond which will be repaid at maturityevaluationDate - the date when the price of the bond is evaluated.dateOfCoupons - an array of dates where the first term corresponds to the date of the first coupon payment, the second term to the second coupon payment and so on...maturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
DurationConvexityDemoException
RemoteException
public double priceOfBond(double yield,
double[] coupons,
double[] time2Coupons,
double principleSum,
double maturity)
throws DurationConvexityDemoException,
RemoteException
yield - the continuously compounded yield which the bond pays expressed in decimal format (i.e. 1 percent = 0.01)coupons - an array where the first term is the first coupon payment and the second term is the second coupon payment and so ontime2Coupons - an array of doubles where the first element represents the time until the first coupon payment is made, the second the time until the second coupon payment is made and so onprincipleSum - the principle sum of the bond which will be repaid at maturitymaturity - the time in years until the bond matures
DurationConvexityDemoException
RemoteException
public double duration(double yield,
double[] payments,
Date evaluationDate,
Date[] paymentDates,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
throws DurationConvexityDemoException,
RemoteException
yield - the continuous compounded yield paid by the bond expressed in decimal format (i.e. 1 percent = 0.01)payments - an array of doubles where the first element represents the first payment from the bond, the second the second payment and so on.principleSum - the principle sum paid by the bond at maturityevaluationDate - the date on which the duration of the bond is evaluatedpaymentDates - an array of dates where the first term corresponds to the first payment date and the second payment date corresponds to the second payment and so on...maturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
DurationConvexityDemoException
RemoteException
public double duration(double yield,
double[] payments,
double[] time2Payments,
double principleSum,
double maturity)
throws DurationConvexityDemoException,
RemoteException
yield - the continuous compounded yield paid by the bond expressed in decimal format (i.e. 1 percent = 0.01)payments - an array of doubles where the first element represents the first payment from the bond, the second the second payment and so on.time2Payments - an array of doubles where the first element represents the time in years until the first payment is made, the second the time in years until the second payment is made and so onprincipleSum - the principle sum paid by the bond at maturitymaturity - the time in years until the bond matures
DurationConvexityDemoException
RemoteException
public double percentagePriceChange(double deltaYield,
double duration)
throws DurationConvexityDemoException,
RemoteException
deltaYield - the small parallel shift (in absolute terms) of the interest rate curve. That is, if the implied 3 month yield is 3.5 percent, and the 6 month yield is 3.7 percent then a parallel shift of 0.1, would result in a 3 month yield of 3.6 percent and a 6 month yield of 3.8 percent.duration - the duration of the bond
DurationConvexityDemoException
RemoteException
public double[] weightOfBonds(double[] valueOfBond)
throws DurationConvexityDemoException,
RemoteException
valueOfBond - an array where the first element corresponds to the value of the first bond within the portfolio and the second element corresponds to the value of the second bond and so on.
DurationConvexityDemoException
RemoteException
public double durationOfPortfolio(double[] duration,
double[] weightOfBond)
throws DurationConvexityDemoException,
RemoteException
duration - an array where the first term is the duration of the first element of the portfolio and second term is the duration of the second term and so on...weightOfBond - an array where the first element corresponds to the weight of the first element within the portfolio and the second term corresponds to the weight of the second element within the portfolio and so on...
DurationConvexityDemoException
RemoteExceptionweightOfBonds - Use this method to find the weights of the bonds within a portfolio,
duration - Use this method to find the duration of each member of the portfolio
public double durationOfPortfolioValue(double[] duration,
double[] valueOfBond)
throws DurationConvexityDemoException,
RemoteException
valueOfBond - an array where the first term is the value of the first bond within the portfolio and the second term is the value of the second bond within the portfolio and on so...
DurationConvexityDemoException
RemoteExceptionduration - Use this method to find the duration of each member of the portfolio
public double percentagePriceChange(double deltaYield,
double[] duration,
double[] valueOfBond)
throws DurationConvexityDemoException,
RemoteException
deltaYield - the small parallel shift (in absolute terms) of the interest rate curve.duration - an array where the first value is the duration of the first bond within the portfolio and the second term is the duration of the second bond within the portfolio and so onvalueOfBond - an array where the first term corresponds to the value of the first bond within the portfolio and the second term corresponds to the weight of the second term within the portfolio and so on
DurationConvexityDemoException
RemoteExceptionduration - Use in order to evaluate the duration of each bond
within the portfolio.
public double percentagePriceChange(double duration,
double annualYield,
double deltaYield)
throws DurationConvexityDemoException,
RemoteException
duration - the duration of the bond portfolioannualYield - the annual yield of the bond portfolio expressed in decimal format (i.e. 1 percent = 0.01)deltaYield - the small parallel shift in the bond portfolios yield, expressed in decimal format
DurationConvexityDemoException
RemoteExceptiondurationOfPortfolio - Use in order to evaluate the duration
of the portfolio.
public double percentagePriceChange(double duration,
double yield,
int periodsCompoundedOver,
double deltaYield)
throws DurationConvexityDemoException,
RemoteException
duration - the duration of the bond portfolioyield - the yield of the bond portfolio compounded `periodsCompoundedOver' time a yearperiodsCompoundedOver - the number of time periods per annum which the yield is compounded overdeltaYield - the small parallel shift in the bond portfolios yield, expressed in decimal format
DurationConvexityDemoException
RemoteException
public double convexity(double yield,
double[] coupons,
Date evaluationDate,
Date[] dateOfCoupons,
double principleSum,
Date maturityDate,
BusinessCalendar businessCalendar)
throws DurationConvexityDemoException,
RemoteException
yield - the continuously compounded yield of the bond portfolio expressed in decimal format (i.e. 1 percent = 0.01)coupons - an array of doubles where the first term corresponds to the amount paid by the next coupon paid by the bond, the second term corresponds to the coupon after that and so onprincipleSum - the principle sum paid at the maturity of the bondevaluationDate - the date when the convexity of the bond is evaluated.dateOfCoupons - an array of dates where the first term corresponds to the date of the first coupon payment and the second term corresponds to the date of second coupon payment and so on...maturityDate - the date when the bond maturesbusinessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
DurationConvexityDemoException
RemoteException
public double convexity(double yield,
double[] coupons,
double[] time2Coupons,
double principleSum,
double maturity)
throws DurationConvexityDemoException,
RemoteException
yield - the continuously compounded yield of the bond portfolio expressed in decimal format (i.e. 1 percent = 0.01)coupons - an array of doubles where the first term corresponds to the amount paid by the next coupon paid by the bond, the second term corresponds to the coupon after that and so ontime2Coupons - an array where the first element is the time in years until the first coupon payment, the second term is the time (in years) until the second coupon payment and so onprincipleSum - the principle sum paid at the maturity of the bondmaturity - the time (in years) until the bond matures
DurationConvexityDemoException
RemoteException
public double bondPriceChange(double duration,
double convexity,
double yieldChange)
throws DurationConvexityDemoException,
RemoteException
duration - the duration of the bond portfolioconvexity - the convexity of the bond portfolioyieldChange - the change (in absolute terms) in the yield of the bond portfolio
DurationConvexityDemoException
RemoteExceptionconvexity,
duration
public double durationHedgeRatio(double futuresPrice,
double duration,
double forwardValue,
double durationPort)
throws DurationConvexityDemoException,
RemoteException
futuresPrice - the contract price of the interest rate futures contractduration - the duration of the asset underlying the futures contract at the maturity of the futures contractforwardValue - the forward value of the portfolio being hedged at the maturity of the hedgedurationPort - the duration of the portfolio at the maturity of the hedge
DurationConvexityDemoException
RemoteException
|
WebCab Bonds Demo (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||