optstocksensbylr
Determine option prices or sensitivities using Leisen-Reimer binomial tree model
Syntax
Description
calculates option prices or sensitivities using a Leisen-Reimer binomial tree model.PriceSens
= optstockbylr(LRTree
,OptSpec
,Strike
,Settle
,ExerciseDates
)
Note
Alternatively, you can use the Vanilla
object to calculate
price or sensitivities for vanilla options. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
adds optional name-value pair arguments for PriceSens
= optstockbylr(___,Name,Value
)AmericanOpt
and
OutSpec
.
Examples
Compute Option Prices and Sensitivities Using a Leisen-Reimer Binomial Tree Model
This example shows how to compute option prices and sensitivities using a Leisen-Reimer binomial tree model. Consider European call and put options with an exercise price of $100 that expire on December 1, 2010. The underlying stock is trading at $100 on June 1, 2010 and has a volatility of 30% per annum. The annualized continuously compounded risk-free rate is 7% per annum. Using this data, compute the price, delta and gamma of the options using the Leisen-Reimer model with a tree of 25 time steps and the PP2
method.
AssetPrice = 100; Strike = 100; ValuationDate = datetime(2010,6,1); Maturity = datetime(2010,12,1); % define StockSpec Sigma = 0.3; StockSpec = stockspec(Sigma, AssetPrice); % define RateSpec Rates = 0.07; Settle = ValuationDate; Basis = 1; Compounding = -1; RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', Settle, ... 'EndDates', Maturity, 'Rates', Rates, 'Compounding', Compounding, 'Basis', Basis); % build the Leisen-Reimer (LR) tree with 25 time steps LRTimeSpec = lrtimespec(ValuationDate, Maturity, 25); % use the PP2 method LRMethod = 'PP2'; TreeLR = lrtree(StockSpec, RateSpec, LRTimeSpec, Strike, 'method', LRMethod); % compute prices and sensitivities using the LR model: OptSpec = {'call'; 'put'}; OutSpec = {'Price', 'Delta', 'Gamma'}; [Price, Delta, Gamma] = optstocksensbylr(TreeLR, OptSpec, Strike, Settle, ... Maturity, 'OutSpec', OutSpec)
Price = 2×1
10.1332
6.6937
Delta = 2×1
0.6056
-0.3944
Gamma = 2×1
0.0185
0.0185
Input Arguments
LRTree
— Stock tree structure
structure
Stock tree structure, specified by lrtree
.
Data Types: struct
OptSpec
— Definition of option
cell array of character vectors with values 'call'
or
'put'
Definition of the option as 'call'
or 'put'
,
specified as a NINST
-by-1
cell array of character
vectors with values 'call'
or 'put'
.
Data Types: char
| cell
Strike
— Option strike price values
vector of nonnegative integers
Option strike price value, specified with nonnegative integer:
For a European option, use a
NINST
-by-1
vector of strike prices.For a Bermuda option, use a
NINST
-by-NSTRIKES
vector of strike prices. Each row is the schedule for one option. If an option has fewer thanNSTRIKES
exercise opportunities, the end of the row is padded withNaN
s.For an American option, use a
NINST
-by-1
vector of strike prices.
Data Types: double
Settle
— Settlement or trade date
datetime array | string array | date character vector
Settlement or trade date, specified as an
NINST
-by-1
vector using a datetime array, string
array, or date character vectors.
To support existing code, optstocksensbylr
also
accepts serial date numbers as inputs, but they are not recommended.
ExerciseDates
— Option exercise dates
datetime array | string array | date character vector
Option exercise dates, specified as a
NINST
-by-1
or
NINST
-by-NSTRIKEDATES
vector using a datetime
array, string array, or date character vectors, where each row is the schedule for one
option and the last element of each row must be the same as the maturity of the tree.
For a European option, use a
NINST
-by-1
vector of dates. For a European option, there is only oneExerciseDate
on the option expiry date.For a Bermuda option, use a
NINST
-by-NSTRIKEDATES
vector of dates.For an American option, use a
NINST
-by-1
vector of exercise dates. For the American type, the option can be exercised on any tree data between theValuationDate
and tree maturity.
To support existing code, optstocksensbylr
also
accepts serial date numbers as inputs, but they are not recommended.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: [Price,Delta,Gamma] =
optstocksensbylr(LRTree,OptSpec,Strike,Settle,ExerciseDates,'OutSpec',OutSpec)
AmericanOpt
— Option type
0
European or Bermuda (default) | values: [0,1]
Option type, specified as the comma-separated pair consisting of
'AmericanOpt'
and a
NINST
-by-1
vector of flags with values:
0
— European or Bermuda1
— American
Data Types: double
OutSpec
— Define outputs
{'Price'}
(default) | cell array of character vectors with values: 'Price'
,
'Delta'
, 'Gamma'
, 'Vega'
,
'Lambda'
, 'Rho'
, 'Theta'
,
and 'All'
Define outputs, specified as the comma-separated pair consisting of
'OutSpec'
and a NOUT
- by-1
or 1
-by-NOUT
cell array of character vectors
with possible values of 'Price'
, 'Delta'
,
'Gamma'
, 'Vega'
, 'Lambda'
,
'Rho'
, 'Theta'
, and
'All'
.
OutSpec = {'All'}
specifies that the output should be
Delta
, Gamma
, Vega
,
Lambda
, Rho
, Theta
, and
Price
, in that order. This is the same as specifying
OutSpec
to include each sensitivity:
Example: OutSpec =
{'delta','gamma','vega','lambda','rho','theta','price'}
Data Types: char
| cell
Output Arguments
PriceSens
— Expected future prices or sensitivities values
vector
Expected future prices or sensitivities values, returned as a
NINST
-by-1
vector.
Data Types: double
More About
Vanilla Option
A vanilla option is a category of options that includes only the most standard components.
A vanilla option has an expiration date and straightforward strike price. American-style options and European-style options are both categorized as vanilla options.
The payoff for a vanilla option is as follows:
For a call:
For a put:
where:
St is the price of the underlying asset at time t.
K is the strike price.
For more information, see Vanilla Option.
References
[1] Leisen D.P., M. Reimer. “Binomial Models for Option Valuation – Examining and Improving Convergence.” Applied Mathematical Finance. Number 3, 1996, pp. 319–346.
Version History
Introduced in R2010bR2022b: Serial date numbers not recommended
Although optstocksensbylr
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
See Also
optstockbylr
| lrtree
| Vanilla
Topics
- Pricing Equity Derivatives Using Trees
- Pricing European Call Options Using Different Equity Models
- Price European Vanilla Call Options Using Black-Scholes Model and Different Equity Pricers
- Vanilla Option
- Supported Equity Derivative Functions
- Mapping Financial Instruments Toolbox Functions for Equity, Commodity, FX Instrument Objects
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)