Finance - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Finance/LatticePrice

Finance

  

LatticePrice

  

return the net present value of the given instruments computed using a binomial or trinomial tree

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

LatticePrice(instrument, model, discountrate, opts)

Parameters

instrument

-

one-asset option, swaption, cap, floor, or collar data structure; financial instrument

model

-

binomial or trinomial tree; tree approximation for the underlying stochastic process

discountrate

-

non-negative constant or a yield term structure; discount rate

opts

-

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

Options

• 

daycounter =  a string containing a date specification in a format recognized by ParseDate or a date data structure -- This option specifies a day counter or day counting convention.

• 

referencedate =  a string containing a date specification in a format recognized by ParseDate or a date data structure -- This option specifies the reference date, that is, the date when the discount factor is 1. By default this is set to the global evaluation date.

Description

• 

The LatticePrice command computes the net present value of the specified financial instrument using the specified lattice approximation for the underlying stochastic process.

• 

The parameter instrument is a financial instrument to be valued. At the present the following instruments are supported:

– 

a one-asset option of the American, Bermudan, or European type (see AmericanOption, BermudanOption, or EuropeanOption)

– 

a swaption of the American, Bermudan, or European type (see AmericanSwaption, BermudanSwaption, or EuropeanSwaption)

– 

interest rate cap, floor, or collar (see Cap, Floor, or Collar)

• 

The parameter model is a binomial or trinomial tree.

• 

The parameter discountrate is the discount rate. It can be either a non-negative constant or a yield term structure. In the former case the reference date and the day count convention for the underlying term structure can be provided using the options daycounter and referencedate.

• 

Note that all internal computations are performed at the hardware precision.

Examples

withFinance:

Set the global evaluation date to January 3, 2006.

SetEvaluationDateJanuary 3, 2006:

Settingsdaycounter=Thirty360European:

Construct a binomial tree approximating a Black-Scholes process with an initial value of 100, a risk-free rate of 10%, and constant volatility of 40%. Assume that no dividend is paid. Build the tree by subdividing the time period 0..0.6 into 1000 equal time steps.

TBlackScholesBinomialTree100,0.1,0.0,0.4,0.6,1000:

Consider an American put option with a strike price of 100 that matures in 6 months.

PS→max100S,0

P:=S→max100S,0

(1)

A1AmericanOptionP,0,0.5:

MaturityAdvanceDateEvaluationDate,6,Months,output=formatted

Maturity:=July 3, 2006

(2)

YearFractionMaturity

0.5000000000

(3)

A2AmericanOptionP,EvaluationDate,Maturity:

Calculate the price of this option using the tree constructed above. Use the risk-free rate as the discount rate.

LatticePriceA1,T,0.1

9.220859736

(4)

LatticePriceA2,T,0.1

9.220859736

(5)

The next set of examples will demonstrate how to price American-style swaptions using Hull-White trinomial trees.

SetEvaluationDateNovember 17, 2006:

EvaluationDate

November 17, 2006

(6)

nominalamt1000.0

nominalamt:=1000.0

(7)

fixing_days2

fixing_days:=2

(8)

startAdvanceDate1,Years,EURIBOR

start:=November 17, 2007

(9)

maturityAdvanceDatestart,5,Years,EURIBOR

maturity:=November 17, 2012

(10)

discount_curveForwardCurve0.04875825,'daycounter'=Actual365Fixed

discount_curve:=moduleend module

(11)

fixed_scheduleSchedulestart,maturity,Annual,'convention'=Unadjusted,'calendar'=EURIBOR

fixed_schedule:=moduleend module

(12)

floating_scheduleSchedulestart,maturity,Semiannual,'convention'=ModifiedFollowing,'calendar'=EURIBOR

floating_schedule:=moduleend module

(13)

benchmarkBenchmarkRate6,Months,EURIBOR,0.04875825

benchmark:=moduleend module

(14)

Construct an interest rate swap receiving the fixed-rate payments in exchange for the floating-rate payments.

swapInterestRateSwapnominalamt,0.0,fixed_schedule,benchmark,floating_schedule,0.0

swap:=moduleend module

(15)

Compute the at-the-money rate for this interest rate swap.

atm_rateFairRateswap,discount_curve

atm_rate:=0.04996048632

(16)

Construct three swaps.

itm_swapInterestRateSwapnominalamt,0.8atm_rate,fixed_schedule,benchmark,floating_schedule,0.0

itm_swap:=moduleend module

(17)

atm_swapInterestRateSwapnominalamt,1.0atm_rate,fixed_schedule,benchmark,floating_schedule,0.0

atm_swap:=moduleend module

(18)

otm_swapInterestRateSwapnominalamt,1.2atm_rate,fixed_schedule,benchmark,floating_schedule,0.0

otm_swap:=moduleend module

(19)

Here are cash flows for the paying leg of our interest rate swap.

cash_flowsCashFlowsitm_swap,paying

cash_flows:=39.96838906 on 'November 17, 2008',39.96838906 on 'November 17, 2009',39.96838906 on 'November 17, 2010',39.96838906 on 'November 17, 2011',39.96838906 on 'November 19, 2012'

(20)

Here are cash flows for the receiving leg of our interest rate swap.

CashFlowsitm_swap,receiving

24.67872558 on 'May 19, 2008',24.40119905 on 'November 17, 2008',24.81751704 on 'May 18, 2009',24.53995292 on 'November 17, 2009',24.67872558 on 'May 17, 2010',24.67872558 on 'November 17, 2010',24.67872558 on 'May 17, 2011',24.67872558 on 'November 17, 2011',24.67872558 on 'May 17, 2012',24.95632730 on 'November 19, 2012'

(21)

These are the days when coupon payments are scheduled to occur.

datesmapt→tdate,cash_flows

dates:=date,date,date,date,date

(22)

itm_swaptionAmericanSwaptionitm_swap,AdvanceDatestart,1,Days,EURIBOR,AdvanceDatedates2,1,Days,EURIBOR

itm_swaption:=moduleend module

(23)

atm_swaptionAmericanSwaptionatm_swap,AdvanceDatestart,1,Days,EURIBOR,AdvanceDatedates2,1,Days,EURIBOR

atm_swaption:=moduleend module

(24)

otm_swaptionAmericanSwaptionotm_swap,AdvanceDatestart,1,Days,EURIBOR,AdvanceDatedates2,1,Days,EURIBOR

otm_swaption:=moduleend module

(25)

Price these swaptions using the Hull-White trinomial tree.

a0.048696

a:=0.048696

(26)

σ0.0058904

σ:=0.0058904

(27)

modelHullWhiteModeldiscount_curve,a,σ

model:=moduleend module

(28)

time_gridTimeGridYearFractionmaturity+0.5,100

time_grid:=moduleend module

(29)

short_rate_treeShortRateTreemodel,time_grid

short_rate_tree:=moduleend module

(30)

Price your swaptions using the tree constructed above.

LatticePriceitm_swaption,short_rate_tree,discount_curve

54.62494411

(31)

LatticePriceatm_swaption,short_rate_tree,discount_curve

29.46563575

(32)

LatticePriceotm_swaption,short_rate_tree,discount_curve

15.16495357

(33)

Compatibility

• 

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

• 

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

See Also

Finance[BermudanSwaption]

Finance[BinomialTree]

Finance[BlackScholesBinomialTree]

Finance[BlackScholesTrinomialTree]

Finance[EuropeanSwaption]

Finance[GetDescendants]

Finance[GetProbabilities]

Finance[GetUnderlying]

Finance[ImpliedBinomialTree]

Finance[ImpliedTrinomialTree]

Finance[LatticeMethods]

Finance[LatticePrice]

Finance[SetProbabilities]

Finance[ShortRateTree]

Finance[StochasticProcesses]

Finance[TreePlot]

Finance[TrinomialTree]

 


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