cdsrpv01
Compute risky present value of a basis point for credit default swap
Syntax
Description
adds optional name-value arguments.RPV01
= cdsrpv01(___,Name,Value
)
[
computes the risky present value of a basis point (RPV01),
RPV01
,PaymentDates
,PaymentTimes
]
= cdsrpv01(ZeroData
,ProbData
,Settle
,Maturity
)PaymentDates
, and PaymentTimes
for a
credit default swap (CDS).
[
computes the risky present value of a basis point (RPV01),
RPV01
,PaymentDates
,PaymentTimes
]
= cdsrpv01(___,Name,Value
)PaymentDates
, and PaymentTimes
for a
credit default swap (CDS) using optional name-value pair arguments.
Examples
Calculate the RPV01
Value for a CDS
Calculate the RPV01
value, given the following specification for a CDS.
Settle = '17-Jul-2009'; % valuation date for the CDS Zero_Time = [.5 1 2 3 4 5]'; Zero_Rate = [1.35 1.43 1.9 2.47 2.936 3.311]'/100; Zero_Dates = daysadd(Settle,360*Zero_Time,1); ZeroData = [Zero_Dates Zero_Rate]; ProbData = [daysadd(datenum(Settle),360,1), 0.0247]; Maturity = datetime(2010,9,20); RPV01 = cdsrpv01(ZeroData,ProbData,Settle,Maturity)
RPV01 = 1.1651
Input Arguments
ZeroData
— Dates and zero rates
object from IRDataCurve
or vector of dates and zero
rates
Dates and zero rates, specified by an
M
-by-2
vector of dates, using a
serial date number format, and zero rates or the
IRDataCurve
object for zero rates. For more
information on an IRDataCurve
(Financial Instruments Toolbox) object, see
Creating an IRDataCurve Object (Financial Instruments Toolbox).
Data Types: object
| double
ProbData
— Dates and default probabilities
vector of dates and default probabilities
Dates and default probabilities, specified by a
P
-by-2
array, where dates use a
serial date number format.
Data Types: double
Settle
— Settlement date
datetime scalar | string scalar | date character vector
Settlement date, specified by a scalar datetime, string, or date character
vector. This must be earlier than or equal to the dates in
Maturity
.
To support existing code, cdsrpv01
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: char
| string
| datetime
Maturity
— CDS maturity date
datetime array | string array | date character vector | serial date number
CDS maturity date, specified by an
N
-by-1
vector using a datetime
array, string array, or date character vectors. The CDS premium payment
dates occur at regular intervals, and the last payment occurs on these
maturity dates.
To support existing code, cdsrpv01
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: char
| string
| datetime
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: RPV01 =
cdsrpv01(ZeroData,ProbData,Settle,Maturity,'Period',1,'StartDate','20-Sep-2010','Basis',1,
'BusinessDayConvention',actual,'CleanRPV01',true,'PayAccruedPremium',true,'ZeroCompounding',1,'ZeroBasis',1)
Period
— Number of premium payments per year
4
(default) | positive integer from the set
[1,2,3,4,6,12]
| vector of positive integers from the set
[1,2,3,4,6,12]
Number of premium payments per year, specified as the comma-separated
pair consisting of 'Period'
and an
N
-by-1
vector. Values are
1
, 2
, 3
,
4
, 6
, and
12
.
Data Types: double
StartDate
— Dates the CDS premium leg starts
Settle
date (default) | datetime array | string array | date character vector
Dates when the CDS premium leg actually starts, specified as the
comma-separated pair consisting of 'StartDate'
and an
N
-by-1
vector using a datetime
array, string array, or date character vectors. Must be on or between
the Settle
and Maturity
dates. For
a forward-starting CDS, specify this date as a future date after
Settle
.
To support existing code, cdsrpv01
also
accepts serial date numbers as inputs, but they are not recommended.
Data Types: char
| string
| datetime
Basis
— Day-count basis of contract
2
(actual/360) (default) | positive integers of the set [1...13]
| vector of positive integers of the set
[1...13]
Day-count basis of the contract, specified as the comma-separated pair
consisting of 'Basis'
and a positive integer using a
NINST
-by-1
vector.
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
BusinessDayConvention
— Business day conventions
actual
(default) | character vector | cell array of character vectors
Business day conventions, specified as the comma-separated pair
consisting of 'BusinessDayConvention'
and a character
vector or N
-by-1
cell array of
character vectors of business day conventions. The selection for
business day convention determines how non-business days are treated.
Non-business days are defined as weekends plus any other date that
businesses are not open (e.g. statutory holidays). Values are:
actual
— Non-business days are effectively ignored. Cash flows that fall on non-business days are assumed to be distributed on the actual date.follow
— Cash flows that fall on a non-business day are assumed to be distributed on the following business day.modifiedfollow
— Cash flows that fall on a non-business day are assumed to be distributed on the following business day. However if the following business day is in a different month, the previous business day is adopted instead.previous
— Cash flows that fall on a non-business day are assumed to be distributed on the previous business day.modifiedprevious
— Cash flows that fall on a non-business day are assumed to be distributed on the previous business day. However if the previous business day is in a different month, the following business day is adopted instead.
Data Types: char
| cell
CleanRPV01
— Flag for premium accrual
true
(default) | boolean flag with value true
or
false
Flag for premium accrual, specified as the comma-separated pair
consisting of 'CleanRPV01'
and a
N
-by-1
vector of Boolean
flags, which is true
if the premium accrued at
StartDate
is excluded in the RPV01, and
false
otherwise.
Data Types: logical
PayAccruedPremium
— Flag for accrued premium payment
true
(default) | boolean flag with value true
or
false
Flag for accrued premium payment, specified as the comma-separated
pair consisting of 'PayAccruedPremium'
and a
N
-by-1
vector of Boolean
flags, true
if accrued premiums are paid upon
default, false
otherwise.
Data Types: logical
ZeroCompounding
— Compounding frequency of zero curve
2
semiannual compounding (default) | integer with acceptable value [1,2,3,4,6,12,
–1
]
Compounding frequency of the zero curve, specified as the
comma-separated pair consisting of 'ZeroCompounding'
and an integer with values:
1
— Annual compounding2
— Semiannual compounding3
— Compounding three times per year4
— Quarterly compounding6
— Bimonthly compounding12
— Monthly compounding−1
— Continuous compounding
Note
When ZeroData
is an
IRDataCurve
object, the arguments
ZeroCompounding
and
ZeroBasis
are implicit in
ZeroData
and are redundant inside this
function. In that case, specify these optional arguments when
constructing the IRDataCurve
object before
calling this function.
Data Types: double
ZeroBasis
— Basis of zero curve
0
(actual/actual) (default) | positive integers of the set [1...13]
| vector of positive integers of the set
[1...13]
Basis of the zero curve, specified as the comma-separated pair
consisting of 'ZeroBasis'
and a positive integer
using a NINST
-by-1
vector.
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
Output Arguments
RPV01
— RPV01 value
scalar | vector
RPV01 value, returned as an N
-by-1
vector.
PaymentDates
— Payment dates
scalar | vector
Payment dates, returned as an
N
-by-numCF
matrix of dates.
PaymentTimes
— Payment times
scalar | vector
Payment times, returned as an
N
-by-numCF
matrix of accrual
fractions.
More About
RPV01
RPV01, associated with a CDS, is the value of a stream of 1-basis-point premiums according to the payment structure of the CDS contract, and considering the default probability over time.
For more information, see [3] and [4] for details.
References
[1] Beumee, J., D. Brigo, D. Schiemert, and G. Stoyle. “Charting a Course Through the CDS Big Bang.” Fitch Solutions, Quantitative Research. Global Special Report. April 7, 2009.
[2] Hull, J., and A. White. “Valuing Credit Default Swaps I: No Counterparty Default Risk.” Journal of Derivatives. Vol. 8, pp. 29–40.
[3] O'Kane, D. and S. Turnbull. “Valuation of Credit Default Swaps.” Lehman Brothers, Fixed Income Quantitative Credit Research. April, 2003.
[4] O'Kane, D. Modelling Single-name and Multi-name Credit Derivatives. Wiley Finance, 2008.
Version History
Introduced in R2013bR2022b: Serial date numbers not recommended
Although cdsrpv01
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
cdsbootstrap
| cdsspread
| cdsprice
| cdsoptprice
(Financial Instruments Toolbox) | IRDataCurve
(Financial Instruments Toolbox)
Topics
- Pricing a CDS Index Option (Financial Instruments Toolbox)
- Credit Default Swap Option (Financial Instruments Toolbox)
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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 bat365 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)