defprobstrip
Syntax
Description
bootstraps a OutCurve
= defprobstrip(ZeroCurve
,MarketInstruments
,MarketQuotes
)defprobcurve
object from market CDS
instruments.
specifies options using one or more name-value pair arguments in addition to any of the
input argument combinations in the previous syntax. OutCurve
= defprobstrip(___,Name,Value
)
Examples
Bootstrap Default Probability Curve from Market CDS
Instruments
This example shows how to use defprobstrip
to bootstrap a defprobcurve
object based on market CDS
instruments.
Create ratecurve
Object for Zero-Rate Curve
Create a ratecurve
object using ratecurve
.
Settle = datetime(2017,9,15);
ZeroTimes = [calmonths(6) calyears([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 = Settle + ZeroTimes;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates);
Market CDS Spreads and Vector of Market CDS
Instruments
Define the market CDS spreads and use fininstrument
to create a vector of market CDS
instrument objects.
SpreadTimes = [1 2 3 4 5 7 10 20 30]'; Spread = [140 175 210 265 310 360 410 460 490]'; MarketDates = datemnth(Settle,12*SpreadTimes); NumMarketInst = length(MarketDates); ContractSpreadBP = zeros(NumMarketInst,1); MarketCDSInstruments(NumMarketInst,1) = fininstrument("cds", ... 'ContractSpread', ContractSpreadBP(end), 'Maturity', MarketDates(end)); for k = 1:NumMarketInst MarketCDSInstruments(k,1) = fininstrument("cds", ... 'ContractSpread', ContractSpreadBP(k), 'Maturity', MarketDates(k)); end
Use defprobstrip
to create a defprobcurve
object.
DefaultProbCurve = defprobstrip(ZeroCurve,MarketCDSInstruments, Spread)
DefaultProbCurve = defprobcurve with properties: Settle: 15-Sep-2017 Basis: 2 Dates: [9x1 datetime] DefaultProbabilities: [9x1 double]
Input Arguments
ZeroCurve
— Zero-rate curve
ratecurve
object
Zero-rate curve, specified by a previously created ratecurve
.
Data Types: object
MarketInstruments
— Market CDS instruments
vector
Market CDS instruments, specified as an
NINST
-by-1
vector.
Data Types: double
MarketQuotes
— Market spread
vector
Market quotes, specified as an NINST
-by-1
vector.
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: DefaultProbCurve = defprobstrip(ZeroCurve, MarketInstruments,
MarketQuotes,'QuoteType',"upfront")
QuoteType
— Market quote type
"fairspread"
(default) | string with value of "fairspread"
or "upfront"
| character vector with value of 'fairspread'
or
'upfront'
Frequency of payments per year, specified as the comma-separated pair consisting
of 'QuoteType'
and a scalar character vector or string.
"fairspread"
— CDS break-even spread for zero upfront price"upfront"
— CDS upfront price for a given contractual spread
Data Types: char
| string
ProbDates
— Dates for probability data
NINST
-by-1
vector of maturity dates in MarketInstruments
input (default) | datetime array | string array | date character vector
Dates for probability data, specified as the comma-separated pair consisting of
'ProbDates'
and a P
-by-1
vector of dates for the output defprobcurve
object, given as a
datetime array, string array, or date character vectors.
To support existing code, defprobstrip
also
accepts serial date numbers as inputs, but they are not recommended.
Output Arguments
OutCurve
— Default probability curve
defprobcurve
object
Default probability curve, returned as a defprobcurve
object with the
following properties:
Settle
Basis
Dates
DefaultProbabilities
Version History
Introduced in R2020aR2022b: Serial date numbers not recommended
Although defprobstrip
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 (한국어)