asiansensbylevy
Calculate prices or sensitivities of European arithmetic Asian options using Levy model
Syntax
Description
returns European average pricing or sensitivities for arithmetic Asian options using the
Levy model.PriceSens
= asiansensbylevy(RateSpec
,StockSpec
,OptSpec
,Strike
Settle
,ExerciseDates
)
Note
Alternatively, you can use the Asian
object to calculate
prices or sensitivities for Asian options. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
adds optional name-value pair arguments.PriceSens
= asiansensbylevy(___,Name,Value
)
Examples
Compute the Price and Sensitivities of an Asian Option Using the Levy Model
Define the RateSpec
.
Rates = 0.07; StartDates = datetime(2013,1,1); EndDates = datetime(2014,1,1); RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates, 'EndDates', ... EndDates, 'Rates', Rates, 'Compounding', -1)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: -1
Disc: 0.9324
Rates: 0.0700
EndTimes: 1
StartTimes: 0
EndDates: 735600
StartDates: 735235
ValuationDate: 735235
Basis: 0
EndMonthRule: 1
Define the StockSpec
for the asset.
AssetPrice = 6.8;
Sigma = 0.14;
DivType = 'continuous';
DivAmounts = 0.09;
StockSpec = stockspec(Sigma, AssetPrice, DivType, DivAmounts)
StockSpec = struct with fields:
FinObj: 'StockSpec'
Sigma: 0.1400
AssetPrice: 6.8000
DividendType: {'continuous'}
DividendAmounts: 0.0900
ExDividendDates: []
Define two options for a 'call'
and 'put'
.
Settle = datetime(2013,1,1); ExerciseDates = datetime(2014,1,1); Strike = 6.9; OptSpec = {'call'; 'put'};
Compute the European arithmetic average price and sensitivities for the Asian option using the Levy model.
OutSpec = {'Price', 'Delta', 'Gamma'}; PriceSens = asiansensbylevy(RateSpec, StockSpec, OptSpec, Strike,... Settle, ExerciseDates,'OutSpec', OutSpec)
PriceSens = 2×1
0.1358
0.2921
Input Arguments
StockSpec
— Stock specification for underlying asset
structure
Stock specification for underlying asset, specified using
StockSpec
obtained from stockspec
. For information on the stock specification, see stockspec
.
stockspec
can handle other types of
underlying assets. For example, stocks, stock indices, and commodities. If dividends are
not specified in StockSpec
, dividends are assumed to be
0
.
Data Types: struct
OptSpec
— Definition of option
character vector with values 'call'
or
'put'
| cell array of character vectors
Definition of option, specified as 'call'
or
'put'
using a NINST
-by-1
cell
array of character vectors.
Data Types: char
| cell
Strike
— Option strike price values
nonnegative integer | vector of nonnegative integers
Option strike price values, specified with nonnegative integers using a
NINST
-by-1
vector.
Data Types: single
| double
Settle
— Settlement dates or trade dates
datetime array | string array | date character vector
Settlement dates or trade dates for the Asian option, specified as a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors.
To support existing code, asiansensbylevy
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
vector using a datetime array, string
array, or date character vectors. For a European option, there is only one
ExerciseDates
on the option expiry date.
To support existing code, asiansensbylevy
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: PriceSens =
asiansensbylevy(RateSpec,StockSpec,OptSpec,Strike,Settle,ExerciseDates,'OutSpec',{'All'})
OutSpec
— Define outputs
{'Price'}
(default) | character vector with values: 'Price'
,
'Delta'
, 'Gamma'
, 'Vega'
,
'Lambda'
, 'Rho'
, 'Theta'
,
and 'All'
. | 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 prices or sensitivities of Asian option
vector
Expected prices or sensitivities (defined by OutSpec
) of the
Asian option, returned as an 1
-by-1
vector. If the
OutSpec
is not specified only the price is returned.
More About
Asian Option
An Asian option is a path-dependent option with a payoff linked to the average value of the underlying asset during the life (or some part of the life) of the option.
Asian options are similar to lookback options in that there are two types of Asian options: fixed (average price option) and floating (average strike option). Fixed Asian options have a specified strike, while floating Asian options have a strike equal to the average value of the underlying asset over the life of the option. For more information, see Asian Option.
Version History
Introduced in R2013bR2022b: Serial date numbers not recommended
Although asiansensbylevy
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.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)