Determine spread of credit default swap
[Spread,PaymentDates,PaymentTimes,] = cdsspread(ZeroData,ProbData,Settle,Maturity,)
[Spread,PaymentDates,PaymentTimes,] = cdsspread(___,Name,Value)
This example shows how to use
cdsspread to compute the spread (in basis points) for a CDS contract with the following data.
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 = '20-Sep-2010'; Spread = cdsspread(ZeroData,ProbData,Settle,Maturity)
Spread = 148.2705
ZeroData— Zero rate data
Zero rate data, specified as a
of dates and zero rates or an
of zero rates.
ZeroData is an
ZeroData and are redundant inside this
function. In this case, specify these optional parameters when constructing
IRDataCurve object before using the
ProbData— Default probability values
Default probability values, specified as a
with dates and corresponding cumulative default probability values.
Settle— Settlement date
Settlement date, specified as a
of serial date numbers or date character vectors. The
must be earlier than or equal to the dates in
Maturity— Maturity date
Maturity date, specified as a
of serial date numbers or date character vectors.
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside single quotes (
' '). You can
specify several name and value pair arguments in any order as
Spread = cdsspread(ZeroData,ProbData,Settle,Maturity,'Basis',7,'BusDayConvention','previous')
Any optional input of size
also acceptable as an array of size
or as a single value applicable to all contracts. Single values are
internally expanded to an array of size
'RecoveryRate'— Recovery rate
0.4(default) | decimal
Recovery rate, specified as a
of recovery rates, specified as a decimal from
'Period'— Premium payment frequency
4(default) | numeric with values
Premium payment frequency, specified as a
with values of
'Basis'— Day-count basis of contract
2(actual/360) (default) | positive integers of the set
[1...13]| vector of positive integers of the set
Day-count basis of the contract, specified as a positive integer
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.
'BusDayConvention'— Business day conventions
actual(default) | character vector
Business day conventions, specified by a character vector. 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 (for example, 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
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
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.
'PayAccruedPremium'— Flag for accrued premiums paid upon default
true(default) | integer with value
Flag for accrued premiums paid upon default, specified as a
of Boolean flags that is
true (default) if accrued
premiums are paid upon default,
'TimeStep'— Number of days as time step for numerical integration
10(days) (default) | nonnegative integer
Number of days to take as time step for the numerical integration, specified as a nonnegative integer.
'ZeroCompounding'— Compounding frequency of the zero curve
2(semiannual) (default) | integer with value of
Compounding frequency of the zero curve, specified using values:
1 — Annual compounding
2 — Semiannual compounding
3 — Compounding three times
4 — Quarterly compounding
6 — Bimonthly compounding
12 — Monthly compounding
−1 — Continuous compounding
Spread— Spreads (in basis points)
Spreads (in basis points), returned as a
PaymentDates— Payment dates
Payment dates, returned as a
PaymentTimes— Payment times
Payment times, returned as a
of accrual fractions.
The market, or breakeven, spread value of a CDS.
The CDS spread can be computed by equating the value of the protection leg with the value of the premium leg:
Market Spread * RPV01 = Value of Protection Leg
The left side corresponds to the value of the premium leg, and
this has been decomposed as the product of the market or breakeven
spread times the
RPV01 or 'risky present value
of a basis point' of the contract. The latter is the present value
of the premium payments, considering the default probability. The
Spread can be computed as the ratio of the value of the
protection leg, to the
RPV01 of the contract.
the resulting spread in basis points.
The premium leg is computed as the product of a spread S and
the risky present value of a basis point (
RPV01 is given by:
when no accrued premiums are paid upon default, and it can be approximated by
when accrued premiums are paid upon default. Here, t0 =
the valuation date, and t1,...,tn = T are
the premium payment dates over the life of the contract,T is
the maturity of the contract, Z(t) is the discount
factor for a payment received at time t, and Δ(tj-1,
tj, B) is a day count between dates tj-1 and tj corresponding
to a basis B.
The protection leg of a CDS contract is given by the following formula:
where the integral is approximated with a finite sum over the
discretization τ0 =
0,τ1,...,τM = T.
A breakeven spread S0 makes the value of the premium and protection legs equal. It follows that:
 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.
 Hull, J., and A. White. “Valuing Credit Default Swaps I: No Counterparty Default Risk.” Journal of Derivatives. Vol. 8, pp. 29–40.
 O'Kane, D. and S. Turnbull. “Valuation of Credit Default Swaps.” Lehman Brothers, Fixed Income Quantitative Credit Research, April 2003.