Constructing Lattice Methods Using the Finance Package
Overview
Constant Volatility Binomial Trees
Trinomial Trees
Implied Binomial Trees
References
See Also
There are three main numerical procedures that can be used to value derivatives when exact formulas are not available. These involve the use of recombining trees, Monte Carlo simulation, and finite difference methods. Monte Carlo simulation is used primarily for derivatives where the payoff is dependent on the history of the underlying variable, or where there are several underlying variables. Recombining trees and finite difference methods are particularly useful when the holder has early exercise decisions to make prior to maturity. In addition to valuing a derivative, all the procedures can be used to calculate the market sensitivities (or the Greeks) such as Delta, Gamma, and Vega.
The Financial Modeling package provides various tools for constructing binomial and trinomial tree approximations of stochastic processes. These include simple binomial trees such as Jarrow-Rudd or Cox-Ross-Rubinstein, trinomial trees, implied binomial and trinomial trees as well as general tree-building tools.
BinomialTree
-
construct a recombining binomial tree data structure
BlackScholesBinomialTree
create a recombining binomial tree for a Black-Scholes process
BlackScholesTrinomialTree
create a recombining trinomial tree for a Black-Scholes process
ImpliedBinomialTree
construct an implied Black-Scholes binomial tree
ImpliedTrinomialTree
construct an implied Black-Scholes trinomial tree
ShortRateTree
construct a trinomial tree for a short-rate process
TreePlot
plot a binomial or trinomial tree
TrinomialTree
construct a mutable recombining trinomial tree data structure
The following commands can be used to inspect/manipulate a tree data structure.
GetDescendants
return descendants for a node of a binomial or trinomial tree
GetProbabilities
return probabilities for a node of a binomial or trinomial tree
GetUnderlying
return the value of the underlying for a node of a binomial or trinomial tree
GetLocalVolatility
return the local volatility node of a Black-Scholes binomial or trinomial tree
SetProbabilities
set probabilities for a node of a binomial or trinomial tree
SetUnderlying
set the value of the underlying for a node of a binomial or trinomial tree
Binomial trees are frequently used to approximate the movements in the price of a stock or other asset under the Black-Scholes-Merton model. There are several approaches to building the underlying binomial tree, such as Cox-Ross-Rubinstein, Jarrow-Rudd, and Tian. In all of the approaches above, the lattice is designed so as to minimize the discrepancy between the approximate (discrete) and target (continuous) distributions by matching, exactly or approximately, their first few moments. The rationale for this is that for any fixed number of time steps, a moment-matching lattice is believed to produce better option price estimates.
restart;withFinance:
If you denote by Su and Sd the multiplicative constants for up and down movements in the tree, and by Pu and Pd the probabilities of the upward and the downward movements, then the stock price Sp = Si, j at the i-th time step and the j-th node is
Si,j=S0⁢Suj⁢Sdi−j for i ∈0, 1, ..., n, j ∈ 0, 1, ..., i
and
Pi,j→k={Puk=j+1Pdk=j0otherwis.
You know that the three variables satisfy two equations, so there is some freedom to assign a value to one of the variables. This is the reason leading to the different versions of the binomial tree. In a risk-neutral binomial tree the transition probabilities can then be determined from the no-arbitrage condition
Sp⋅Su⋅Pu+Sp⋅Sd⋅Pd=Sf,
where Sf=expr⋅Δt⋅Sp is the known forward price of the stock. In a general constant volatility recombining binomial tree Su and Sd have the form
Su=ⅇq⁢Δt+σ Δt and Sd=ⅇq⁢Δt−σ Δt
for some reasonable value of q.
Su:=ⅇq⁢Δt+σ Δt
Su:=ⅇq⁢Δt+σ⁢Δt
Sd:=ⅇq⁢Δt−σ Δt
Sd:=ⅇq⁢Δt−σ⁢Δt
Sf:=ⅇr⁢Δt⁢Sp
The corresponding transition probabilities are
solve⁡Sp⁢Su⁢Pu+Sp⁢Sd⁢Pd=Sf,Pu+Pd=1,Pu,Pd;
Pd=−ⅇr⁢Δt+ⅇq⁢Δt+σ⁢Δtⅇq⁢Δt+σ⁢Δt−ⅇq⁢Δt−σ⁢Δt,Pu=−ⅇq⁢Δt−σ⁢Δt−ⅇr⁢Δtⅇq⁢Δt+σ⁢Δt−ⅇq⁢Δt−σ⁢Δt
assign⁡;
Pu;
−ⅇq⁢Δt−σ⁢Δt−ⅇr⁢Δtⅇq⁢Δt+σ⁢Δt−ⅇq⁢Δt−σ⁢Δt
Pd;
−ⅇr⁢Δt+ⅇq⁢Δt+σ⁢Δtⅇq⁢Δt+σ⁢Δt−ⅇq⁢Δt−σ⁢Δt
Consider the Black-Scholes process with the following parameters:
r:=0.03;
r:=0.03
σ≔0.2;
σ:=0.2
N:=20;
N:=20
T:=3.0;
T:=3.0
Δt:=TN
Δt:=0.1500000000
Cox-Ross-Rubinstein Binomial Tree
The binomial tree introduced by Cox, Ross and Rubinstein in 1979 (hereafter CRR) is one of the most important innovations to have appeared in the option pricing literature. Beyond its original use as a tool to approximate the prices of European and American options in the Black-Scholes (1973) framework, it is also widely used as a pedagogical device to introduce various key concepts in option pricing. CRR presented the fundamental economic principles of option pricing by arbitrage considerations in the most simplest manner. By application of a central limit theorem, they proved that their model merges into the Black and Scholes model when the time steps between successive trading instances approach zero. Additionally, the model was used to evaluate American type options and options on assets with continuous dividend payments. The Cox, Ross, and Rubinstein model makes the multiplication of up and down jumps equal
Su = expσ⋅Tn, Sd = exp− σ⋅Tn,
Pu = a⋅exprTn − du − d = exprTn − exp−σ Tnexpσ Tn − exp−σ Tn .
This corresponds to the case when q=0.
q≔0;
q:=0
CRR:=BinomialTree⁡T,N,100,Su,Pu,Sd,Pd:
TreePlot⁡CRR,axes=BOXED,thickness=3,gridlines=true;
Here is a logarithmic view of the same tree.
TreePlot⁡CRR,axes=BOXED,thickness=3,gridlines=true,scale=logarithmic;
GetProbabilities⁡CRR,2,2
0.5097284963,0.4902715037
Jarrow-Rudd Binomial Tree
There exist many extensions of the CRR model. Jarrow and Rudd (1983), JR, adjusted the CRR model to account for the local drift term
Su = expr − σ22Tn + σTn, Sd = expr − σ22Tn − σTn.
They constructed a binomial model where the first two moments of the discrete and continuous time-return processes match. As a consequence, a probability measure equal to one half results. This corresponds to the case when q=r−σ22.
q≔r−σ22;
q:=0.01000000000
Su,Sd;
1.082160674,0.9268535887
Pu,Pd;
0.5000193723,0.4999806277
JR≔BinomialTreeT,N,100,Su,Pu,Sd,Pd:
TreePlot⁡JR,axes=BOXED,thickness=3,gridlines=true;
TreePlot⁡JR,axes=BOXED,thickness=3,gridlines=true,scale=logarithmic;
X:=ItoProcess⁡0.1,sin⁡t,0.1,x,t;
X:=_X
Drift⁡X⁡t;
sin⁡t
Diffusion⁡X⁡t;
0.1
The Financial Modeling package provides some tools for approximating diffusions using trinomial trees.
T:=ShortRateTree⁡X,5.0,10:
TreePlot⁡T,thickness=2,color=blue,gridlines=true;
In this example you will construct an implied binomial tree and use it to price some other instruments.
r:=0.11;
r:=0.11
d:=0.04;
d:=0.04
σ:=ImpliedVolatilitySurface⁡0.11−K−100⋅0.00110,t,K:
T:=ImpliedBinomialTree⁡100,r,d,σ,3,7:
Here are two different views of the same tree; the first one uses the standard scale, the second one uses the logarithmic scale.
TreePlot⁡T,thickness=2,axes=BOXED,gridlines=true;
TreePlot⁡T,thickness=2,axes=BOXED,gridlines=true,color=red..blue,scale=logarithmic;
Inspect the tree.
GetProbabilities⁡T,1,1;
0.5000000000,0.5000000000
GetProbabilities⁡T,2,1;
0.3817424623,0.6182575377
GetProbabilities⁡T,2,2;
0.6409710334,0.3590289666
Compare this tree with the standard Cox-Ross-Rubinstein binomial tree constructed for the volatility equal to sigma(0, 100).
T2:=BlackScholesBinomialTree⁡100,r,d,σ⁡0,100,3,7:
P1:=TreePlot⁡T,thickness=2,axes=BOXED,gridlines=true,color=blue:
P2:=TreePlot⁡T2,thickness=2,axes=BOXED,gridlines=true,color=red:
plotsdisplay⁡P1,P2;
P:=S,T→BlackScholesPrice100.,S,T,σT,S,r, d, put;
P:=S,T→Finance:-BlackScholesPrice⁡100.,S,T,σ⁡T,S,r,d,put
C:=S,T→BlackScholesPrice100.,S,T,σT,S,r, d, call;
C:=S,T→Finance:-BlackScholesPrice⁡100.,S,T,σ⁡T,S,r,d,call
P100,1.0;
1.62044795
C100,1.0;
8.11597835
T:=ImpliedBinomialTree⁡100,r,d,σ,1,200:
E:=EuropeanOption⁡t→max⁡t−100,0,1.0:
LatticePrice⁡E,T,r;
8.146123180
evalf⁡C⁡100,1.0;
BlackScholesPrice100.,100,1.0,r,σ0.0,100,d, call;
So, the results match in this case.
E:=EuropeanOption⁡t→max⁡t−130,0,1.0:
0.1622684190
evalf⁡C⁡130,1.0;
0.16229691
BlackScholesPrice100.,130,1.0,σ0.0,100,r, d, call;
0.18855320
You can price other kinds of options using this tree.
q:=t→piecewise⁡t<90,0,t<110,t−90,t<130,130−t,0;
q:=t→piecewise⁡t<90,0,t<110,t−90,t<130,130−t,0
plot⁡q,80..150,gridlines,thickness=3;
E:=EuropeanOption⁡q,1.0:
9.644001241
A:=AmericanOption⁡q,0,1.0:
LatticePrice⁡A,T,r;
14.07012078
John C. Hull, Options, Futures, and Other Derivatives, Prentice Hall, 2002
Global Derivatives, http://www.global-derivatives.com/
MathFinance, http://www.mathfinance.de/
Lishang Jiang, Mathematical Modeling and Methods of Option Pricing, Higher Education Press, 2003
Michel Denault, Genevieve Gauthier, and Jean-Guy Simonato, Improving Lattice Schemes Throught Bias Reduction, 2003
Leisen, D. and Reimer, M. (1996). Binomial Models For Option Valuation - Examining and Improving Convergence. Applied Mathematical Finance 3 pp. 319-346
Trigeorgis, L., A Log-Transformed Binomial Numerical Analysis Method for Valuing Complex Multi-Option Investments, Journal of Financial and Quantitative Analysis, Vol. 26, pp. 309-326, 1991
Calendars worksheet, Term Structures worksheet, Stochastic Processes worksheet, Day Counters worksheet, Cash Flow Analysis worksheet
Download Help Document