volatilities
Compute implied volatilities when using SABR
pricer
Description
computes implied volatilities for a outVolatilities
= volatilities(inpPricer
,ExerciseDate
,ForwardValue
,Strike
)Swaption
instrument when you
use a SABR
pricer.
Examples
This example shows the workflow to compute implied volatilities for a Swaption
Instrument.
Create ratecurve Object
Create a ratecurve
object using ratecurve
.
ValuationDate = datetime(2016,3,5); ZeroDates = datemnth(ValuationDate,[1 2 3 6 9 12*[1 2 3 4 5 6 7 8 9 10 12]])'; ZeroRates = [-0.33 -0.28 -0.24 -0.12 -0.08 -0.03 0.015 0.028 ... 0.033 0.042 0.056 0.095 0.194 0.299 0.415 0.525]'/100; Compounding = 1; ZeroCurve = ratecurve("zero",ValuationDate,ZeroDates,ZeroRates,'Compounding',Compounding)
ZeroCurve = ratecurve with properties: Type: "zero" Compounding: 1 Basis: 0 Dates: [16×1 datetime] Rates: [16×1 double] Settle: 05-Mar-2016 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create SABR
Model Object
Use finmodel
to create a SABR
model object.
Alpha = 0.0135; Beta = 0.5; Rho = 0.4654; Nu = 0.4957; Shift = 0.008; SABRModel = finmodel("SABR",'Alpha',Alpha,'Beta',Beta,'Rho',Rho,'Nu',Nu,'Shift',Shift)
SABRModel = SABR with properties: Alpha: 0.0135 Beta: 0.5000 Rho: 0.4654 Nu: 0.4957 Shift: 0.0080 VolatilityType: "black"
Create SABR
Pricer Object
Use finpricer
to create a SABR
pricer object and use the ratecurve
object for the 'DiscountCurve'
name-value pair argument.
SABRPricer = finpricer("Analytic", 'Model', SABRModel,'DiscountCurve', ZeroCurve)
SABRPricer = SABR with properties: DiscountCurve: [1×1 ratecurve] Model: [1×1 finmodel.SABR]
Compute Implied Volatilities
Use volatilities
to compute the implied volatilities for a Swaption
instrument.
SwaptionExerciseDate = datetime(2017,3,5); ForwardValue = 0.0007; StrikeGrid = [-0.5; -0.25; -0.125; 0; 0.125; 0.25; 0.5; 1.0; 1.5]/100; MarketStrikes = ForwardValue + StrikeGrid; outVolatilities = volatilities(SABRPricer, SwaptionExerciseDate, ForwardValue, MarketStrikes)
outVolatilities = 9×1
0.2132
0.1500
0.1409
0.1474
0.1609
0.1752
0.2004
0.2372
0.2627
Input Arguments
SABR pricer, specified as a previously created SABR
pricer
object.
Data Types: object
Option exercise date, specified as a scalar datetime, string, or date character vector.
To support existing code, volatilities
also
accepts serial date numbers as inputs, but they are not recommended.
Forward swap rate, specified as a scalar decimal.
Data Types: object
Strike rate, specified as a scalar decimal.
Data Types: double
Output Arguments
Output volatilities, returned as a numeric.
More About
Implied volatility is the market's expectations of the future volatility of the underlying asset's price over the life of an option.
Implied volatility is derived from the market price of an option using an options pricing model. Implied volatility is a key input for traders and investors as it helps gauge market sentiment and the potential for price fluctuations.
Version History
Introduced in R2020bAlthough volatilities
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)