# cdsoptprice

Price payer and receiver credit default swap options

## Syntax

``[Payer,Receiver] = cdsoptprice(ZeroData,ProbData,Settle,OptionMaturity,CDSMaturity,Strike,SpreadVol)``
``[Payer,Receiver] = cdsoptprice(___,Name,Value)``

## Description

example

````[Payer,Receiver] = cdsoptprice(ZeroData,ProbData,Settle,OptionMaturity,CDSMaturity,Strike,SpreadVol)` computes the price of payer and receiver credit default swap options. NoteAlternatively, you can use the `CDSOption` object to price credit default swap options. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments. ```

example

````[Payer,Receiver] = cdsoptprice(___,Name,Value)` computes the price of payer and receiver credit default swap options with additional options specified by one or more `Name,Value` pair arguments.```

## Examples

collapse all

Use `cdsoptprice` to generate `Payer` and `Receiver` values for a credit default swap option.

```Settle = datenum('12-Jun-2012'); OptionMaturity = datenum('20-Sep-2012'); CDSMaturity = datenum('20-Sep-2017'); OptionStrike = 200; SpreadVolatility = .4; Zero_Time = [.5 1 2 3 4 5]'; Zero_Rate = [.5 .75 1.5 1.7 1.9 2.2]'/100; Zero_Dates = daysadd(Settle,360*Zero_Time,1); ZeroData = [Zero_Dates Zero_Rate]; Market_Time = [1 2 3 5 7 10]'; Market_Rate = [100 120 145 220 245 270]'; Market_Dates = daysadd(Settle,360*Market_Time,1); MarketData = [Market_Dates Market_Rate]; ProbData = cdsbootstrap(ZeroData, MarketData, Settle); [Payer,Receiver] = cdsoptprice(ZeroData, ProbData, Settle,... OptionMaturity, CDSMaturity, OptionStrike, SpreadVolatility)```
```Payer = 223.5780 ```
```Receiver = 22.7460 ```

## Input Arguments

collapse all

Zero rates, specified by using a `M`-by-`2` vector of dates and zero rates or an `IRDataCurve` object of zero rates. For more information on an `IRDataCurve` object, see Creating an IRDataCurve Object..

Data Types: `double` | `object`

Probability of default, specified as a `P`-by-`2` array of dates and default probabilities.

Data Types: `double`

Settlement date, specified as a scalar using a serial nonnegative date number or date character vector. `Settle` must be earlier than the `OptionMaturity` date.

Data Types: `double` | `char`

Option maturity dates, specified as an `NINST`-by-`1` vector using a serial nonnegative date number or date character vector.

Data Types: `double` | `char`

CDS maturity dates, specified as an `NINST`-by-`1` vector using a serial nonnegative date number or date character vector.

Data Types: `double` | `char`

Option strikes in basis points, specified as an `NINST`-by-`1` vector.

Data Types: `double`

Annualized credit spread volatilities, specified an `NINST`-by-`1` vector of positive decimals.

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: ```[Payer,Receiver] = cdsoptprice(ZeroData,ProbData,Settle,OptionMaturity,CDSMaturity,OptionStrike,SpreadVolatility)```

Adjusted forward spread in basis points, specified as the comma-separated pair consisting of `'AdjustedForwardSpread'` and an `NINST`-by-`1` vector.

Data Types: `double`

Day count basis, specified as the comma-separated pair consisting of `'Basis'` and an `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

Data Types: `double`

Business day conventions, specified as the comma-separated pair consisting of `'BusinessDayConvention'` and a character vector or a `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`

Indicator of knockout, specified as the comma-separated pair consisting of `'Knockout'` and an `NINST`-by-`1` vector of boolean flags. If the credit default swaptions is a knockout, the flag is `True`, otherwise it is `False`.

Data Types: `logical`

Indicator of accrued premium, specified as the comma-separated pair consisting of `'PayAccruedPremium'` and an `NINST`-by-`1` vector of boolean flags. If accrued premiums are paid upon default, the flag is `True`, otherwise it is `False`.

Data Types: `logical`

Premiums per year of CDS, specified as the comma-separated pair consisting of `'Period'` and a `NINST`-by-`1` vector. Allowed values are `1`, `2`, `3`, `4`, `6`, and `12`.

Data Types: `double`

Recovery rates, specified as the comma-separated pair consisting of `'RecoveryRate'` and a `NINST`-by-`1` vector of decimal values from `0` to `1`.

Data Types: `double`

Basis of zero curve, specified as the comma-separated pair consisting of `'ZeroBasis'` and an `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

Data Types: `double`

Compounding frequency of zero curve, specified as the comma-separated pair consisting of `'ZeroCompounding'` and an integer with one of the following allowed 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

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`

## Output Arguments

collapse all

Payer swap options in `Basis` points, returned as an `NINST`-by-`1` vector of prices.

Receiver swap options in `Basis` points, returned as an `NINST`-by-`1` vector of prices.

collapse all

### Credit Default Swap Option

A credit default swap (CDS) option, or credit default swaption, is a contract that provides the option holder with the right, but not the obligation, to enter into a credit default swap in the future.

CDS options can either be payer swaptions or receiver swaptions. In a payer swaption, the option holder has the right to enter into a CDS in which they are paying premiums and in a receiver swaption, the option holder is receiving premiums.

## Algorithms

The payer and receiver credit default swap options are computed using the Black's model as described in O'Kane [1]:

`${V}_{Pay\left(Knockout\right)}=RPV01\left(t,{t}_{E},T\right)\left(F\Phi \left({d}_{1}\right)-K\Phi \left({d}_{2}\right)\right)$`
`${V}_{Rec\left(Knockout\right)}=RPV01\left(t,{t}_{E},T\right)\left(K\Phi \left(-{d}_{2}\right)-F\Phi \left(-{d}_{1}\right)\right)$`
`${d}_{1}=\frac{\mathrm{ln}\left(\frac{F}{K}\right)+\frac{1}{2}{\sigma }^{2}\left({t}_{E}-t\right)}{\sigma \sqrt{{t}_{E}-t}}$`
`${d}_{2}={d}_{1}-\sigma \sqrt{{t}_{E}-t}$`
`${V}_{Pay\left(Non-Knockout\right)}={V}_{Pay\left(Knockout\right)}+FEP$`
`${V}_{Pay\left(Non-Knockout\right)}={V}_{Rec\left(Knockout\right)}$`

where

RPV01 is the risky present value of a basis point (see `cdsrpv01`).

Φ is the normal cumulative distribution function.

t is the valuation date.

tE is the option expiry date.

T is the CDS maturity date.

F is the forward spread (from option expiry to CDS maturity).

FEP is the front-end protection (from option initiation to option expiry).

## References

[1] O'Kane, D. Modelling Single-name and Multi-name Credit Derivatives. Wiley, 2008, pp. 156–169.

## Version History

Introduced in R2011a