Main Content

cdsspread

Determine spread of credit default swap

Description

example

[Spread,PaymentDates,PaymentTimes,] = cdsspread(ZeroData,ProbData,Settle,Maturity,)computes the spread of the CDS.

example

[Spread,PaymentDates,PaymentTimes,] = cdsspread(___,Name,Value)adds optional name-value pair arguments.

Examples

collapse all

This example shows how to usecdsspreadto compute the spread (in basis points) for a CDS contract with the following data.

Settle ='17-Jul-2009';% valuation date for the CDSZero_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

Input Arguments

collapse all

Zero rate data, specified as aM-by-2vector of dates and zero rates or anIRDataCurveobject of zero rates.

WhenZeroDatais anIRDataCurveobject,ZeroCompoundingandZeroBasisare implicit inZeroData里面是多余的这个函数。在这个case, specify these optional parameters when constructing theIRDataCurveobject before using thecdsspreadfunction.

For more information on anIRDataCurve(Financial Instruments Toolbox)object, seeCreating an IRDataCurve Object(Financial Instruments Toolbox).

Data Types:double|struct

Default probability values, specified as aP-by-2matrix with dates and corresponding cumulative default probability values.

Data Types:double|char

Settlement date, specified as a scalar serial date number or date character vector. TheSettledate must be earlier than or equal to the dates inMaturity.

Data Types:double|char

Maturity date, specified as aN-by-1vector of serial date numbers or date character vectors.

Data Types:double|char

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis 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 encloseNamein quotes.

Example:Spread = cdsspread(ZeroData,ProbData,Settle,Maturity,'Basis',7,'BusinessDayConvention','previous')

Note

Any optional input of sizeN-by-1is also acceptable as an array of size1-by-N, or as a single value applicable to all contracts. Single values are internally expanded to an array of sizeN-by-1.

Recovery rate, specified as the comma-separated pair consisting of'RecoveryRate'and aN-by-1vector of recovery rates, specified as a decimal from0to1.

Data Types:double

Premium payment frequency, specified as the comma-separated pair consisting of'Period'and aN-by-1vector with values of1,2,3,4,6, or12.

Data Types:double

Day-count basis of the contract, specified as the comma-separated pair consisting of'Basis'and a positive integer using aNINST-by-1vector.

  • 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, seeBasis.

Data Types:double

Business day conventions, specified as the comma-separated pair consisting of'BusinessDayConvention'and 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-非业务天实际上是忽视了。现金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

Flag for accrued premiums paid upon default, specified as the comma-separated pair consisting of'PayAccruedPremium'and aN-by-1vector of Boolean flags that istrue(default) if accrued premiums are paid upon default,falseotherwise.

Data Types:logical

Number of days to take as time step for the numerical integration, specified as the comma-separated pair consisting of'TimeStep'和一个非负整数。

Data Types:double

Compounding frequency of the zero curve, specified as the comma-separated pair consisting of'ZeroCompounding'and an integer with values:

  • 1— Annual compounding

  • 2— Semiannual compounding

  • 3— Compounding three times per year

  • 4— Quarterly compounding

  • 6— Bimonthly compounding

  • 12— Monthly compounding

  • −1— Continuous compounding

Data Types:double

Basis of the zero curve, specified as the comma-separated pair consisting of'ZeroBasis'and a positive integer with values that are identical toBasis.

Data Types:double

Output Arguments

collapse all

Spreads (in basis points), returned as aN-by-1vector.

Payment dates, returned as aN-by-numCFmatrix.

Payment times, returned as aN-by-numCFmatrix of accrual fractions.

More About

collapse all

CDS Spread

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 theRPV01or 'risky present value of a basis point' of the contract. The latter is the present value of the premium payments, considering the default probability. TheMarket Spreadcan be computed as the ratio of the value of the protection leg, to theRPV01of the contract.cdsspreadreturns the resulting spread in basis points.

Algorithms

The premium leg is computed as the product of a spreadSand the risky present value of a basis point (RPV01). TheRPV01is given by:

R P V 01 = j = 1 N Z ( t j ) Δ ( t j 1 , t j , B ) Q ( t j )

when no accrued premiums are paid upon default, and it can be approximated by

R P V 01 1 2 j = 1 N Z ( t j ) Δ ( t j 1 , t j , B ) ( Q ( t j 1 ) + Q ( t j ) )

when accrued premiums are paid upon default. Here,t0=0is the valuation date, andt1,...,tn=Tare the premium payment dates over the life of the contract,Tis the maturity of the contract,Z(t)is the discount factor for a payment received at timet, andΔ(tj-1, tj, B)is a day count between datestj-1andtjcorresponding to a basisB.

The protection leg of a CDS contract is given by the following formula:

P r o t e c t i o n L e g = 0 T Z ( τ ) ( 1 R ) d P D ( τ )

( 1 R ) i = 1 M Z ( τ i ) ( P D ( τ i ) P D ( τ i 1 ) )

= ( 1 R ) i = 1 M Z ( τ i ) ( Q ( τ i 1 ) Q ( τ i ) )

where the integral is approximated with a finite sum over the discretizationτ0=0,τ1,...,τM=T.

A breakeven spreadS0makes the value of the premium and protection legs equal. It follows that:

S 0 = P r o t e c t i o n L e g R P V 0 1

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.

版本嗨story

Introduced in R2010b