create new zero curve based on the specified discount factors - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Interest Rates : Finance/DiscountCurve

Finance[DiscountCurve] - create new zero curve based on the specified discount factors

Calling Sequence

DiscountCurve(rate, opts)

DiscountCurve(times, rates, opts)

DiscountCurve(dates, rates, opts)

Parameters

rate

-

real constant, algebraic expression, or a procedure; discount factor

times

-

list or Vector of non-negative constants; times (in years)

rates

-

list or Vector of non-negative constants; discount factors

dates

-

list of dates in one of the formats recognized by the ParseDate command; dates

opts

-

equations of the form option = value where option is one of daycounter, interpolation, or referencedate; specify options for the DiscountCurve command

Description

• 

The DiscountCurve command creates a new yield curve based on the specified discount factors; the resulting curve is represented as a module. This module can be passed to other commands of the Finance package that expect a yield term structure as one of the parameters; it can also be used as if it were a procedure. Assume for example that the module returned by DiscountCurve was assigned to the name R. Then for any positive constant t, Rt will return a discount factor for the maturity t based on the term structure R. If d is a date given in any of the formats recognized by the ParseDate command, then the Rd command will return the discount factor for the corresponding maturity.

• 

The DiscountCurve(rate, opts) command creates a zero curve based on the specified interest rate. The parameter rate can be either a real constant, a Maple procedure or an algebraic expression. If rate is a real constant then the DiscountCurve command contracts a flat term structure based on the specified interest rate. If rate is a procedure it should accept one parameter (the time) and return the corresponding rate as a floating-point number. Finally, if rate is an algebraic expression, it should depend on a single variable. This variable will be taken as time.

• 

The DiscountCurve(times, rates, opts) and DiscountCurve(dates, rates, opts) commands create a term structure based on piecewise interpolation of specified discount factors. The parameters rates and times can be either a list or a Vector containing numeric values and must have the same number of elements. The parameter dates is a list of dates in one of the formats recognized by ParseDate.

• 

Objects created using the DiscountCurve command will be of Maple type YieldTermStructure.

Examples

withFinance:

SetEvaluationDateNovember 25, 2006:

In this example create a discount curve based on a piecewise interpolation of discount rates. Use the linear interpolation.

discountfactors:=1.,0.995,0.989,0.981,0.975,0.964,0.944,0.930,0.914,0.886,0.860,0.842,0.832,0.831,0.827,0.823,0.815,0.795,0.778,0.770:

times:=0.25,0.50,0.75,1.0,1.2,1.5,1.8,2.0,2.2,2.5,2.8,3.0,3.2,3.5,3.8,4.0,4.2,4.5,4.8,5.0:

discountcurve:=DiscountCurvetimes,discountfactors:

ZeroRatediscountcurve,0.5

0.01002508365

(1)

ForwardRatediscountcurve,0.5

0.02419362214

(2)

DiscountFactordiscountcurve,0.5

0.9950000000

(3)

date2:=AdvanceDate6,Months

date2:=May 25, 2007

(4)

time2:=YearFractiondate2

time2:=0.4958904110

(5)

discountcurvedate2

0.9950819893

(6)

discountcurvetime2

0.9950819893

(7)

Construct discount curves based on different types of interpolation of the given rates.

discountcurve2:=DiscountCurvetimes,discountfactors,interpolation=BackwardFlat:

discountcurve3:=DiscountCurvetimes,discountfactors,interpolation=ForwardFlat:

discountcurve4:=DiscountCurvetimes,discountfactors,interpolation=Cubic:

plotdiscountcurve,discountcurve2,discountcurve3,discountcurve4,0..5,color=red,blue,green,cyan,thickness=2,axes=BOXED,gridlines=true

Construct a discount yield term structure based on a Maple function.

f:=CurveFitting:-Splinetimes,discountfactors,t,degree=4

f:=&lcub;0.01189941604t4&plus;0.01189941604t30.004462281015t20.01905099728t&plus;1.004902195t<0.37500000000.03172492545t4&plus;0.04163768016t30.02119005458t20.01486905389t&plus;1.004510138t<0.62500000000.1039594708t40.2975733104t3&plus;0.2968202491t20.1473733471t&plus;1.025213935t<0.87500000000.08853890118t4&plus;0.3761709898t30.5874691433t2&plus;0.3684621307t&plus;0.9123749242t<1.1000000000.1197353883t4&plus;0.5134355333t30.813955640t2&plus;0.5345522282t&plus;0.8667001473t<1.3500000000.2499934793t41.483100351t3&plus;3.229029530t23.104134427t&plus;2.094756886t<1.6500000000.2653533436t4&plus;1.918188680t35.189160821t2&plus;6.155874957t1.724996984t<1.9000000000.0787759053t40.6971936111t3&plus;2.264678708t23.285655115t&plus;2.759729805t<2.1000000000.1910343021t41.640164145t3&plus;5.235035885t27.444155159t&plus;4.942942325t<2.3500000000.2857346683t4&plus;2.841464179t310.56270395t2&plus;17.30563722t9.59756069t<2.6500000000.5174704068t45.672509617t3&plus;23.28034189t242.48374377t&plus;30.01290422t<2.9000000000.4144089660t4&plus;5.137291107t323.74229127t2&plus;48.42668042t35.89715344t<3.1000000000.2814239993t4&plus;3.488277521t316.07437810t2&plus;32.57965988t23.61571253t<3.3500000000.3604175437t45.112399153t3&plus;27.14402216t263.94143401t&plus;57.22070354t<3.6500000000.2866325131t4&plus;4.334531678t324.57792413t2&plus;61.91530196t57.62356812t<3.9000000000.1353767710t42.248813156t3&plus;13.93464317t238.21737304t&plus;40.00579001t<4.1000000000.1815123228t43.005436205t3&plus;18.58787492t250.93620650t&plus;53.04259433t<4.3500000000.1245093110t4&plus;2.319340223t316.15629127t2&plus;49.82187548t56.53181988t<4.6500000000.09220898271t4&plus;1.718554117t311.96580818t2&plus;36.83137790t41.43036638t<4.9000000000.2218548599t44.437097198t3&plus;33.27822899t2110.9658102t&plus;139.6211887otherwise

(8)

discountcurve5:=DiscountCurvef&colon;

plotdiscountcurve&comma;discountcurve5&comma;0..2&comma;color&equals;red&comma;blue&comma;thickness&equals;2&comma;axes&equals;BOXED&comma;gridlines&equals;true

See Also

Finance[BlackScholesProcess], Finance[DiscountFactor], Finance[ForwardCurve], Finance[ForwardRate], Finance[MertonJumpDiffusion], Finance[ParRate], Finance[ZeroCurve], Finance[ZeroRate]

References

  

Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice. New York: Springer-Verlag, 2001.

  

Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam