impvbybaw
Calculate implied volatility using Barone-Adesi and Whaley option pricing model
Syntax
Description
adds
optional name-value pair arguments.Volatility
= impvbybaw(___,Name,Value
)
Examples
Compute the Implied Volatility for an American Option Using the Barone-Adesi and Whaley Option Pricing Model
This example shows how to compute implied volatility using the Barone-Adesi and Whaley option pricing model. Consider three American call options with exercise prices of $100 that expire on July 1, 2017. The underlying stock is trading at $100 on January 1, 2017 and pays a continuous dividend yield of 10%. The annualized continuously compounded risk-free rate is 10% per annum, and the option prices are $4.063, $6.77 and $9.46. Using this data, calculate the implied volatility of the stock using the Barone-Adesi and Whaley option pricing model.
AssetPrice = 100; Settle = 'Jan-1-2017'; Maturity = 'Jul-1-2017'; Strike = 100; DivAmount = 0.1; Rate = 0.05;
Define the RateSpec
.
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle,... 'EndDates', Maturity, 'Rates', Rate, 'Compounding', -1, 'Basis', 1)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: -1
Disc: 0.9753
Rates: 0.0500
EndTimes: 0.5000
StartTimes: 0
EndDates: 736877
StartDates: 736696
ValuationDate: 736696
Basis: 1
EndMonthRule: 1
Define the StockSpec
.
StockSpec = stockspec(NaN, AssetPrice, {'continuous'}, DivAmount)
StockSpec = struct with fields:
FinObj: 'StockSpec'
Sigma: NaN
AssetPrice: 100
DividendType: {'continuous'}
DividendAmounts: 0.1000
ExDividendDates: []
Define the American option.
OptSpec = {'call'};
OptionPrice = [4.063;6.77;9.46];
Compute the implied volatility for the American option.
ImpVol = impvbybaw(RateSpec, StockSpec, Settle, Maturity, OptSpec,...
Strike, OptionPrice)
ImpVol = 3×1
0.1802
0.2808
0.3803
Input Arguments
StockSpec
— Stock specification for underlying asset
structure
Stock specification for the underlying asset. For information
on the stock specification, see stockspec
.
stockspec
handles several
types of underlying assets. For example, for physical commodities
the price is StockSpec.Asset
, the volatility is StockSpec.Sigma
,
and the convenience yield is StockSpec.DividendAmounts
.
Data Types: struct
Settle
— Settlement date
serial date number | date character vector | datetime object
Settlement date for the American option, specified as a NINST
-by-1
matrix
using a serial date number, a date character vector, or a datetime
object.
Data Types: double
| char
| datetime
Maturity
— Maturity date
serial date number | date character vector | datetime object
Maturity date for the American option, specified as a NINST
-by-1
matrix
using a serial date number, a date character vector, or a datetime
object.
Data Types: double
| char
| datetime
OptSpec
— Definition of option
character vector with values 'call'
or
'put'
| string array with values 'call'
or
'put'
Definition of the option as 'call'
or 'put'
, specified
as a NINST
-by-1
cell array of character vectors
or string arrays with values 'call'
or
'put'
.
Data Types: char
| string
Strike
— American option strike price value
nonnegative scalar | nonnegative vector
American option strike price value, specified as a nonnegative
scalar or NINST
-by-1
matrix
of strike price values. Each row is the schedule for one option.
Data Types: single
| double
OptPrice
— American option price
nonnegative scalar | nonnegative vector
American option prices from which the implied volatility of
the underlying asset is derived, specified as a nonnegative scalar
or NINST
-by-1
matrix of strike
price values.
Data Types: single
| double
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: Volatility = impvbybaw(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike,OptionPrice)
Limit
— Lower and upper bound of implied volatility search interval
[0.1 10]
(or 10% to 1000%
per annum) (default) | positive value
Lower and upper bound of implied volatility search interval,
specified as the comma-separated pair consisting of 'Limit'
and
a 1
-by-2
positive vector.
Data Types: double
Tolerance
— Implied volatility search termination tolerance
1e-6
(default) | positive scalar
Implied volatility search termination tolerance, specified as
the comma-separated pair consisting of 'Tolerance'
and
a positive scalar.
Data Types: double
Output Arguments
Volatility
— Expected implied volatility values
matrix
Expected implied volatility values, returned as a NINST
-by-1
matrix.
If no solution can be found, a NaN
is returned.
References
[1] Barone-Adesi, G. and Robert E. Whaley. “Efficient Analytic Approximation of American Option Values.” The Journal of Finance. Volume 42, Issue 2 (June 1987), 301–320.
[2] Haug, E. The Complete Guide to Option Pricing Formulas. Second Edition. McGraw-Hill Education, January 2007.
Version History
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)