capbynormal
Price caps using Normal or Bachelier pricing model
Syntax
Description
[
prices caps using the Normal (Bachelier) pricing model for negative rates.
CapPrice
,Caplets
]
= capbynormal(RateSpec
,Strike
,Settle
,Maturity
,Volatility
)capbynormal
computes prices of vanilla caps and amortizing caps.
Note
Alternatively, you can use the Cap
object to price cap
instruments. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
[
adds optional name-value pair arguments.CapPrice
,Caplets
]
= capbynormal(___,Name,Value
)
Examples
Price a Cap Using Normal Model for Negative Rates
Consider an investor who gets into a contract that caps the interest rate on a $100,000 loan at –.08% quarterly compounded for 3 months, starting on January 1, 2009. Assuming that on January 1, 2008 the zero rate is .069394% continuously compounded and the volatility is 20%, use this data to compute the cap price. First, calculate the RateSpec
, and then use capbynormal
to compute the CapPrice
.
ValuationDate = datetime(2008,1,1); EndDates = datetime(2010,4,1); Rates = 0.0069394; Compounding = -1; Basis = 1; RateSpec = intenvset('ValuationDate', ValuationDate, ... 'StartDates', ValuationDate,'EndDates', EndDates, ... 'Rates', Rates,'Compounding', Compounding,'Basis', Basis); Settle = datetime(2009,1,1); % cap starts in a year Maturity = datetime(2009,4,1); Volatility = 0.20; CapRate = -0.008; CapReset = 4; Principal=100000; CapPrice = capbynormal(RateSpec, CapRate, Settle, Maturity, Volatility,... 'Reset',CapReset,'ValuationDate',ValuationDate,'Principal', Principal,... 'Basis', Basis)
CapPrice = 2.1682e+03
Price a Cap Using capbynormal
and Compare to capbyblk
Define the RateSpec
.
Settle = datetime(2016,1,20); ZeroTimes = [.5 1 2 3 4 5 7 10 20 30]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = datemnth(Settle,12*ZeroTimes); RateSpec = intenvset('StartDate',Settle,'EndDates',ZeroDates,'Rates',ZeroRates)
RateSpec = struct with fields:
FinObj: 'RateSpec'
Compounding: 2
Disc: [10x1 double]
Rates: [10x1 double]
EndTimes: [10x1 double]
StartTimes: [10x1 double]
EndDates: [10x1 double]
StartDates: 736349
ValuationDate: 736349
Basis: 0
EndMonthRule: 1
Define the cap instrument and price with capbyblk
.
ExerciseDate = datetime(2026,1,20); [~,ParSwapRate] = swapbyzero(RateSpec,[NaN 0],Settle,ExerciseDate)
ParSwapRate = 0.0216
Strike = .01; BlackVol = .3; NormalVol = BlackVol*ParSwapRate; Price = capbyblk(RateSpec,Strike,Settle,ExerciseDate,BlackVol)
Price = 11.8693
Price the cap instrument using capbynormal
.
Price_Normal = capbynormal(RateSpec,Strike,Settle,ExerciseDate,NormalVol)
Price_Normal = 12.5495
Price the cap instrument using capbynormal
for a negative strike.
Price_Normal = capbynormal(RateSpec,-.005,Settle,ExerciseDate,NormalVol)
Price_Normal = 24.4816
Input Arguments
Strike
— Rate at which cap is exercised
decimal
Rate at which cap is exercised, specified as a NINST
-by-1
vector
of decimal values.
Data Types: double
Settle
— Settlement date for cap
datetime array | string array | date character vector
Settlement date for the cap, specified as a NINST
-by-1
vector using a datetime array, string array, or date character vectors.
To support existing code, capbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: double
| char
| datetime
| string
Maturity
— Maturity date for cap
datetime array | string array | date character vector
Maturity date for the cap, specified as a NINST
-by-1
vector using a datetime array, string array, or date character vectors.
To support existing code, capbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
Volatility
— Normal volatilities values
numeric
Normal volatilities values, specified as a NINST
-by-1
vector
of numeric values.
For more information on the Normal model, see Work with Negative Interest Rates Using Functions.
Data Types: 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: [CapPrice,Caplets] = capbynormal(RateSpec,Strike,Settle,Maturity,Volatility,'Reset',CapReset,'Principal',100000,'Basis',7)
Reset
— Reset frequency payment per year
1
(default) | numeric
Reset frequency payment per year, specified as the comma-separated
pair consisting of 'Reset'
and a NINST
-by-1
vector.
Data Types: double
Principal
— Notional principal amount
100
(default) | numeric
Notional principal amount, specified as the comma-separated
pair consisting of 'Principal'
and a NINST
-by-1
of
notional principal amounts, or a NINST
-by-1
cell
array. Each element in the NINST
-by-1
cell
array is a NumDates
-by-2
cell
array, where the first column is dates, and the second column is the
associated principal amount. The date indicates the last day that
the principal value is valid.
Use Principal
to pass a schedule to compute
the price for an amortizing cap.
Data Types: double
| cell
Basis
— Day-count basis of instrument
0
(actual/actual) (default) | integer from 0
to 13
Day-count basis of instrument representing the basis used when
annualizing the input forward rate, specified as the comma-separated
pair consisting of 'Basis'
and a NINST
-by-1
vector
of integers. Values are:
0 = actual/actual
1 = 30/360 (SIA)
2 = actual/360
3 = actual/365
4 = 30/360 (PSA)
5 = 30/360 (ISDA)
6 = 30/360 (European)
7 = actual/365 (Japanese)
8 = actual/actual (ICMA)
9 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
ValuationDate
— Observation date of investment horizon
if ValuationDate
is not specified, then Settle
is used (default) | datetime scalar | string scalar | date character vector
Observation date of the investment horizon, specified as the comma-separated pair consisting
of 'ValuationDate'
and a scalar datetime, string, or date character
vector.
To support existing code, capbynormal
also
accepts serial date numbers as inputs, but they are not recommended.
ProjectionCurve
— Rate curve used in generating future cash flows
if ProjectionCurve
is not specified, then RateSpec
is used both for discounting cash flows and projecting future cash flows (default) | structure
The rate curve to be used in projecting the future cash flows,
specified as the comma-separated pair consisting of 'ProjectionCurve'
and
rate curve structure. This structure must be created using intenvset
. Use this optional input if
the forward curve is different from the discount curve.
Data Types: struct
Output Arguments
CapPrice
— Expected price of cap
vector
Expected price of the cap, returned as a NINST
-by-1
vector.
Caplets
— Caplets
array
Caplets, returned as a NINST
-by-NCF
array
of caplets, padded with NaN
s.
More About
Cap
A cap is a contract that includes a guarantee that sets the maximum interest rate to be paid by the holder, based on an otherwise floating interest rate.
The payoff for a cap is:
For more information, see Cap.
Version History
Introduced in R2017aR2022b: Serial date numbers not recommended
Although capbynormal
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)