Finance - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Finance

  

ForwardCurve

  

create new zero curve based on instantaneous forward rates

 

Calling Sequence

Parameters

Options

Description

Examples

References

Compatibility

Calling Sequence

ForwardCurve(rate, opts)

ForwardCurve(times, rates, opts)

ForwardCurve(dates, rates, opts)

Parameters

rate

-

real constant, algebraic expression, or a procedure; forward rate

times

-

list or Vector; times (in years)

rates

-

list or Vector; forward rates

dates

-

list; dates

opts

-

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

Options

• 

compounding = Simple, Continuous, Annual, Semiannual, EveryFourthMonth, Quarterly, Bimonthly, Monthly, SimpleThenAnnual, SimpleThenSemiannual, SimpleThenEveryFourthMonth, SimpleThenQuarterly, SimpleThenBimonthly, or SimpleThenMonthly -- This option specifies the compounding type for the given interest rate(s).

• 

daycounter = Actual360, Actual365Fixed, AFB, Bond, Euro, Historical, ISDA, ISMA, OneDay, Simple, Thirty360BondBasis, Thirty360EuroBondBasis, Thirty360European, Thirty360Italian, Thirty360USA, or a day counter data structure -- This option specifies the convention used to convert the amount of time between two dates to year fractions.

• 

interpolation = BackwardFlat, Cubic, ForwardFlat, Linear, or LogLinear -- This option specifies the type of interpolation used to build a forward curve from a discrete set of rates. The LogLinear interpolation is used by default.

• 

referencedate = date in any of the formats recognized by the ParseDate command -- This option specifies the reference date (when the discount factor is equal to 1).

Description

• 

The ForwardCurve command creates a new yield curve based on the specified instantaneous forward rates; 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 ForwardCurve was assigned to the name R. Then for any positive constant t, Rt will return a zero rate 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 forward rate for the corresponding maturity.

• 

The ForwardCurve(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 ForwardCurve 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 ForwardCurve(times, rates, opts) and ForwardCurve(dates, rates, opts) commands create a term structure based on piecewise interpolation of specified forward rates. 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.

• 

By default all rates are assumed to be based on continuous compounding. The compounding option can be used to specify the desired compounding type for the given rates. If the value of the compounding option is different from Continuous, all the given rates will be converted to the corresponding continuous rates.

• 

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

Examples

withFinance:

In this example, create a flat forward curve with reference date set to January 5, 2005.

forwardcurve1ForwardCurve0.05,referencedate=Jan-05-2006:

forwardcurve1Jan-05-2007

0.05000000000

(1)

forwardcurve11.0

0.05000000000

(2)

In this example, create a forward curve with the same parameters as above but assume that the interest rate is based on the monthly compounding.

forwardcurve2ForwardCurve0.05,compounding=Monthly,referencedate=Jan-05-2005:

Note that in the previous example only the rates passed to the ZeroCurve constructor are assumed to be monthly compounded. Whenever we evaluate forwardcurve2, the returned rate is always continuous.

forwardcurve2Jan-05-2005

0.04989612178

(3)

forwardcurve21.0

0.04989612178

(4)

EquivalentRateforwardcurve21.0,Continuous,Monthly,1.0

0.05000000000

(5)

DiscountFactorforwardcurve2,Jan-05-2005

1.

(6)

In this example, create a forward curve based on a piecewise interpolation of forward rates. Use the default interpolation.

rates0.02,0.01,0.04,0.06,0.07:

times0.0,0.5,1.0,1.5,2.0:

forwardcurve3ForwardCurvetimes,rates:

forwardcurve30.5

0.01000000000

(7)

forwardcurve31.0

0.04000000000

(8)

forwardcurve31.5

0.06000000000

(9)

forwardcurve31.25

0.05000000000

(10)

forwardcurve4ForwardCurvetimes,rates,interpolation=BackwardFlat:

forwardcurve5ForwardCurvetimes,rates,interpolation=Linear:

forwardcurve6ForwardCurvetimes,rates,interpolation=ForwardFlat:

forwardcurve7ForwardCurvetimes,rates,interpolation=Cubic:

plotforwardcurve3,forwardcurve4,forwardcurve5,forwardcurve6,forwardcurve7,0..2,color=red,blue,green,yellow,cyan,thickness=2,axes=BOXED,gridlines=true

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

fCurveFitting:-Splinetimes,rates,t,degree=4

f:=&lcub;0.1631507971t4&plus;0.020.03776323341tt<0.25000000000.1735680803t4&plus;0.3367188774t30.1262695790t20.01671830357t&plus;0.01868469189t<0.75000000000.1214446482t40.5483193081t3&plus;0.8693983798t20.5145522824t&plus;0.1120285630t<1.2500000000.02763974508t4&plus;0.1971026584t30.5282678071t2&plus;0.6501695396t0.2519470064t<1.7500000000.003624442908t4&plus;0.02899554326t30.08698662976t2&plus;0.1353414990t0.02670973855otherwise

(11)

forwardcurve4ForwardCurvef&colon;

plotforwardcurve3&comma;forwardcurve4&comma;forwardcurve7&comma;0..2&comma;color&equals;red&comma;blue&comma;cyan&comma;thickness&equals;2&comma;axes&equals;BOXED&comma;gridlines&equals;true

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.

Compatibility

• 

The Finance[ForwardCurve] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Finance[BlackScholesProcess]

Finance[DiscountCurve]

Finance[DiscountFactor]

Finance[ForwardRate]

Finance[MertonJumpDiffusion]

Finance[ParRate]

Finance[ZeroCurve]

Finance[ZeroRate]

 


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