#include <yieldCurve.h>
Inheritance diagram for yieldCurve:
Public Member Functions | |
yieldCurve (void) | |
Default void constructor. | |
yieldCurve (Real flatRate) | |
FlatCurve. | |
void | assignFlatRate (Real r=0.0) |
For flat rate curves, set the flat rate value. | |
void | assignZCBrateAtIndex (Real rate, Natural i) |
sets an EXISTING rate at a certain level | |
yieldCurve | shiftZCBRateCurve (Real shift=defaultshiftfactorForShortRate) |
for risk mngmt purposes, shifts the yc | |
yieldCurve | rotateZCBRateCurve (Real moveInShortestRate=defaultshiftfactorForShortRate, Real maturityOfRotation=7) |
for risk mngmt purposes, rotates the yc with a ref to how you move the shortest rate, around which rate | |
yieldCurve (valarray< yieldPoint > yieldPoints, char *name="unnamed") | |
Constructor. | |
~yieldCurve (void) | |
virtual Real | spotRate (Real maturity) const |
Calculates the spot ZCB rate. | |
virtual valarray< Real > | getMaturitiesInTheMarketCurve () const |
Return the maturities present in the market curve, both from the Cash and Swap Pointsvalarray<Real>. | |
virtual valarray< Real > | getMaturitiesInTheZCBCurve () const |
Return the maturities present in the market curve, both from the Cash and Swap Pointsvalarray<Real>. | |
virtual Real | spotRate (Date maturityDate) const |
Calculates the spot ZCB rate. | |
virtual Real | discountFactor (Real maturity, interestComposition composition=Continuous) |
Calculates the discountFactor. | |
virtual Real | discountFactor (Date maturityDate, interestComposition composition=Continuous) |
Calculates the discountFactor. | |
virtual Real | forwardDiscountFactor (Real forwardstart, Real lengthofcontractafterstart, interestComposition composition=Continuous) |
Calculates the discountFactor. | |
virtual Real | forwardRate (Real forwardStart, Real effectiveLengthOfTheContractAfterStart, interestComposition composition=Continuous) |
Calculates the fwd rate. | |
virtual Real | forwardRate (Date forwardStart, Date forwardEnd, interestComposition composition=Continuous) |
Calculates the fwd rate. | |
virtual yieldCurve | forwardZCBCurve (Real forwardStart) |
Forward curve. | |
char * | getName () |
virtual bool | operator== (const yieldCurve &yours) |
compares two y curves. | |
virtual bool | operator!= (const yieldCurve &yours) |
Private Member Functions | |
yieldPoint | getPointAtMaturity (Real maturity) |
for know maturities, we can return the market Point as it is | |
void | sortMarketRatesByMaturity () |
Sorting rates by maturity, just in case ... | |
void | sortCashSwap () |
Routine to make sure the short term rates (cash) are before the mid/long term (swap). | |
valarray< yieldPoint > | getSwapRates () |
needed in the bootstrap method to be able to back the ZC | |
valarray< yieldPoint > | getSequentSwapRates () |
1Y difference in swaps -> ZC's easily backed up The method assumes that rates are sorted by ascending maturity The mkt curve is 1Y by 1Y - we should fill in the gaps by linear interpolation | |
void | computeZCBRatesBootstrap () |
Go from the swap rates to the ZC - matrix inversion to be done Swap rates can be annual or semi annual in their most common quotes on the market. | |
valarray< Real > | SequentDiscountFactorsByInvertSwapMatrix () |
Discount Factors corresponding to annual swaps quoted on sequent yrs : X-1 * (1...1)' where X is as follows: - diag = +1 swap (i) - inferior triang (i,j) = swap (i) - superior diag (i,j) =0. | |
Private Attributes | |
valarray< yieldPoint > | _marketRates |
valarray< yieldPoint > | _zcbRates |
char | _name [YC_NAME_STRLEN] |
Friends | |
ostream & | operator<< (ostream &os, const yieldCurve &c) |
display maturities and spotrates in the curve. | |
ostream & | operator<< (ostream &os, const yieldCurve *c) |
|
Default void constructor.
clean ? Definition at line 42 of file yieldCurve.cpp. References _name, assignFlatRate(), computeZCBRatesBootstrap(), and YC_MAX_NUMBER_POINTS. Referenced by creditCurve::combineUnderlyingAndSpreads(), creditCurve::copyObj(), creditCurve::createSpreadCurve(), creditCurve::creditCurve(), forwardZCBCurve(), rotateZCBRateCurve(), and shiftZCBRateCurve(). |
|
FlatCurve.
clean ? Definition at line 64 of file yieldCurve.cpp. References _name, assignFlatRate(), computeZCBRatesBootstrap(), Real, and YC_MAX_NUMBER_POINTS. |
|
Constructor.
clean ? Definition at line 74 of file yieldCurve.cpp. References _name, computeZCBRatesBootstrap(), sortCashSwap(), and sortMarketRatesByMaturity(). |
|
Definition at line 85 of file yieldCurve.cpp. |
|
For flat rate curves, set the flat rate value.
Definition at line 53 of file yieldCurve.cpp. References _marketRates, ACT_360, Cash, Natural, r, and Real. Referenced by yieldCurve(). |
|
sets an EXISTING rate at a certain level
Definition at line 377 of file yieldCurve.cpp. References _zcbRates, Natural, and Real. Referenced by rotateZCBRateCurve(), and shiftZCBRateCurve(). |
|
Go from the swap rates to the ZC - matrix inversion to be done Swap rates can be annual or semi annual in their most common quotes on the market. Having semi annual swaps with annual maturities makes life hard as to bootstrap the ZC's as we would not be able to back out the semi annual ZC's to move to the next step without market bond prices, etc: it would really be cumbersome On the quote screen provided by Prof Laud, swaps are quoted annualy from 2 to 10 -> easy calculation [cf latex Code] as for the 15 - 20 and 30 with frequency annual, we need to find a way to find mid Points 11-14, 16-19 21-29. Definition at line 354 of file yieldCurve.cpp. References _marketRates, _zcbRates, Cash, Natural, Real, and SequentDiscountFactorsByInvertSwapMatrix(). Referenced by yieldCurve(). |
|
Calculates the discountFactor.
Reimplemented in creditCurve. Definition at line 247 of file yieldCurve.cpp. References Day30_360, Date::dayCount(), discountFactor(), Real, and Date::setDateToToday(). |
|
Calculates the discountFactor.
Reimplemented in creditCurve. Definition at line 235 of file yieldCurve.cpp. References Continuous, Discrete, Real, and spotRate(). Referenced by creditCurve::defaultProbability(), discountFactor(), creditCurve::discountFactor(), asset::forwardPrice(), forwardRate(), CashFlow::getFairValue(), mainmc(), bond::quotedPrice(), RainbowOption::RainbowOption(), creditCurve::riskyDiscountFactor(), and creditCurve::swapFees(). |
|
Calculates the discountFactor.
Definition at line 253 of file yieldCurve.cpp. References Continuous, Discrete, forwardRate(), and Real. Referenced by binomialTree::setClaimVariables(). |
|
Calculates the fwd rate.
Reimplemented in creditCurve. Definition at line 298 of file yieldCurve.cpp. References Day30_360, Date::dayCount(), forwardRate(), Real, and Date::setDateToToday(). |
|
Calculates the fwd rate.
Reimplemented in creditCurve. Definition at line 264 of file yieldCurve.cpp. References Continuous, discountFactor(), Discrete, Real, and spotRate(). Referenced by CashFlow::CashFlow(), Drift::Drift(), forwardDiscountFactor(), forwardRate(), creditCurve::forwardRate(), and forwardZCBCurve(). |
|
Forward curve.
Definition at line 279 of file yieldCurve.cpp. References _zcbRates, forwardRate(), Natural, Real, and yieldCurve(). Referenced by VanillaSwap::getTheta(), and Exotics::getTheta(). |
|
Return the maturities present in the market curve, both from the Cash and Swap Pointsvalarray<Real>.
Definition at line 333 of file yieldCurve.cpp. References _marketRates, and Natural. |
|
Return the maturities present in the market curve, both from the Cash and Swap Pointsvalarray<Real>.
Reimplemented in creditCurve. Definition at line 343 of file yieldCurve.cpp. References _zcbRates, and Natural. Referenced by creditCurve::combineUnderlyingAndSpreads(), creditCurve::getMaturitiesInTheZCBCurve(), mainyieldcurve(), operator<<(), and operator==(). |
|
Reimplemented in creditCurve. Definition at line 192 of file yieldCurve.h. References _name. Referenced by creditCurve::getName(). |
|
for know maturities, we can return the market Point as it is
Definition at line 89 of file yieldCurve.cpp. References _marketRates, Natural, and Real. Referenced by sortMarketRatesByMaturity(). |
|
1Y difference in swaps -> ZC's easily backed up The method assumes that rates are sorted by ascending maturity The mkt curve is 1Y by 1Y - we should fill in the gaps by linear interpolation
Swaps are quoted per year sequent then gaps : we need to fill in the gaps with a linear interpolation we know that the first one is in 1Y swap rate (assigned at 1Y cash rate), as for the rest we ahve to Check for 1y sequent swap rates first Definition at line 172 of file yieldCurve.cpp. References getSwapRates(), Natural, Real, and Swap. Referenced by SequentDiscountFactorsByInvertSwapMatrix(). |
|
needed in the bootstrap method to be able to back the ZC
Definition at line 155 of file yieldCurve.cpp. References _marketRates, Cash, Natural, spotRate(), Swap, and YC_MAX_NUMBER_POINTS. Referenced by getSequentSwapRates(). |
|
Definition at line 452 of file yieldCurve.cpp. References operator==(). |
|
compares two y curves. Two y curves are equal if they give identical spotrates for all ZCB maturities in each curve
Definition at line 423 of file yieldCurve.cpp. References getMaturitiesInTheZCBCurve(), m, mergeunique(), Natural, Real, and spotRate(). Referenced by operator!=(). |
|
for risk mngmt purposes, rotates the yc with a ref to how you move the shortest rate, around which rate
Definition at line 399 of file yieldCurve.cpp. References _zcbRates, assignZCBrateAtIndex(), Natural, Real, and yieldCurve(). Referenced by mainyieldcurve(). |
|
Discount Factors corresponding to annual swaps quoted on sequent yrs : X-1 * (1...1)' where X is as follows: - diag = +1 swap (i) - inferior triang (i,j) = swap (i) - superior diag (i,j) =0.
Definition at line 305 of file yieldCurve.cpp. References getSequentSwapRates(), M, and Natural. Referenced by computeZCBRatesBootstrap(). |
|
for risk mngmt purposes, shifts the yc
Definition at line 382 of file yieldCurve.cpp. References _zcbRates, assignZCBrateAtIndex(), Natural, Real, and yieldCurve(). Referenced by VanillaSwap::getRho(), RainbowOption::getRho(), Exotics::getRho(), asset::getRho(), mainyieldcurve(), riskybond::shiftedbond(), treasurybond::shiftedbond(), and volsurface::shiftedYCvolsurface(). |
|
Routine to make sure the short term rates (cash) are before the mid/long term (swap).
Definition at line 134 of file yieldCurve.cpp. References _marketRates, Cash, Natural, and Swap. Referenced by yieldCurve(). |
|
Sorting rates by maturity, just in case ...
Definition at line 112 of file yieldCurve.cpp. References _marketRates, getPointAtMaturity(), Natural, Real, and YC_MAX_NUMBER_POINTS. Referenced by yieldCurve(). |
|
Calculates the spot ZCB rate.
Reimplemented in creditCurve. Definition at line 229 of file yieldCurve.cpp. References Day30_360, Date::dayCount(), Real, Date::setDateToToday(), and spotRate(). |
|
|
Definition at line 100 of file yieldCurve.h. |
|
display maturities and spotrates in the curve.
Definition at line 457 of file yieldCurve.cpp. |
|
Definition at line 199 of file yieldCurve.h. Referenced by assignFlatRate(), computeZCBRatesBootstrap(), getMaturitiesInTheMarketCurve(), getPointAtMaturity(), getSwapRates(), sortCashSwap(), and sortMarketRatesByMaturity(). |
|
Definition at line 201 of file yieldCurve.h. Referenced by getName(), and yieldCurve(). |
|
Definition at line 200 of file yieldCurve.h. Referenced by assignZCBrateAtIndex(), computeZCBRatesBootstrap(), forwardZCBCurve(), getMaturitiesInTheZCBCurve(), rotateZCBRateCurve(), shiftZCBRateCurve(), and spotRate(). |