• No results found

Credit Risk Modeling and Implementation

N/A
N/A
Protected

Academic year: 2022

Share "Credit Risk Modeling and Implementation"

Copied!
50
0
0

Loading.... (view fulltext now)

Full text

(1)

Credit Risk Modeling and Implementation Report 1.2

Johan Gunnars (jogu0081@student.umu.se)

Master’s Thesis in Engineering Physics, 30.0 credits.

(2)

Abstract

The financial crisis and the bankruptcy of Lehman Brothers in 2008 lead to harder regulations for the banking industry which included larger capital re- serves for the banks. One of the parts that contributed to this increased capital reserve was the the credit valuation adjustment capital charge which can be explained as the market value of the counterparty default risk. The purpose of the credit valuation adjustment capital charge is to capitalize the risk of future changes in the market value of the counterparty default risk.

One financial contract that had a key role in the financial crisis was the credit default swap. A credit default swap involves three different parts, a contract seller, a contract buyer and a reference entity. The credit default swap can be seen as an insurance against a credit event, a default for example of the refer- ence entity.

This thesis focuses on the study and calculation of the credit valuation ad- justment of credit default swaps. The credit valuation adjustment on a credit default swap can be implemented with two different assumptions. In the first case, the seller (buyer) of the contract is assumed to be default risk free and then only the buyer (seller) contributes to the default risk. In the second case, both the seller and the buyer of the contract is assumed to be default risky and therefore, both parts contributes to the default risk.

(3)

Sammanfattning

Finanskrisen och Lehman Brothers konkurs 2008 ledde till h˚ardare regleringar f¨or banksektorn som bland annat innefattade krav p˚a st¨orre kapitalreserver f¨or bankerna. En del som bidrog till denna ¨okning av kapitalreserverna var kred- itv¨ardighetsjusteringens kapitalkrav som kan f¨orklaras som marknadsv¨ardet av motpartsrisken. Syftet med kreditv¨ardighetsjusteringens kapitalkrav ¨ar att kap- italisera risken f¨or framtida f¨or¨andringar i marknadsv¨ardet av motpartsrisken.

Ett derivat som hade en nyckelroll under finanskrisen var kreditswappen. En kreditswap innefattar tre parter, en s¨aljare, en k¨opare och ett referensf¨oretag.

Kreditswappen kan ses som en f¨ors¨akring mot en kredith¨andelse, till exempel en konkurs p˚a referensf¨oretaget.

Detta arbete fokuserar p˚a studier och ber¨akningar av kreditv¨ardesjusteringen p˚a kreditswappar. Kreditv¨ardesjusteringen p˚a en kreditswap kan implementeras med tv˚a olika antaganden. I det f¨orsta fallet antas s¨aljaren (k¨oparen) vara risk- fri och d˚a bidrar bara k¨oparen (s¨aljaren) till konkursrisken. I det andra fallet antas b˚ade s¨aljaren och k¨oparen bidra till konkursrisken.

(4)

Contents

1 Introduction 1

1.1 Background . . . 1

1.2 Counterparty Credit Risk . . . 1

1.3 Over-The-Counter . . . 1

1.4 Credit Default Swap . . . 2

1.4.1 Credit event . . . 2

1.4.2 Settlement . . . 3

1.4.3 The Usage of CDS Contracts . . . 3

1.5 Regulations . . . 4

1.6 Credit Valuation Adjustment . . . 5

1.7 Right and Wrong Way Risk . . . 5

2 Theory 6 2.1 Credit Default Swap . . . 6

2.1.1 Premium Leg . . . 6

2.1.2 Protection leg (Payment Leg) . . . 7

2.1.3 Credit Default Swap Payoff . . . 7

2.2 Hazard and Survival Function . . . 8

2.3 Credit Valuation Adjustment . . . 9

2.3.1 Unilateral CVA for CDS . . . 9

2.3.2 Bilateral CVA for CDS . . . 9

2.3.3 Default Correlation . . . 10

2.3.4 CIR++ Intensity Model . . . 11

3 Method 12 3.1 Construction of Hazard Rate and Survival Probability Curve . . 12

3.1.1 Premium Leg . . . 12

3.1.2 Protection leg . . . 12

3.1.3 Bootstrapping hazard rate . . . 13

3.1.4 Survival probability . . . 14

3.2 CVA for CDS . . . 14

3.2.1 Calibration of CIR++ Process . . . 15

3.2.2 CIR++ Simulation . . . 16

3.2.3 Conditional Survival Probability . . . 17

3.2.4 Fractional Fast Fourier Transform . . . 17

3.2.5 Conditional Gaussian Copula Function . . . 19

4 Results 21 4.1 Survival Curve Construction from Market Spreads . . . 21

4.2 Unilateral CVA . . . 23

4.3 Bilateral CVA . . . 26

5 Discussion 30 5.1 Survival Curve Construction from Market Spreads . . . 30

5.2 Unilateral and Bilateral CVA . . . 30

5.3 Future Work . . . 31

5.3.1 Adjoint Algorithmic Differentiation. . . 31

5.3.2 Interest Rate Swaps . . . 31

(5)

5.3.3 Collateralized CVA . . . 31

5.3.4 Calibration of Intensity Process Parameters . . . 31

A Appendix 34 A.1 Derivation of Conditional Copula . . . 34

A.2 CDS Input Data . . . 35

A.3 CVA Input Parameters . . . 37

A.4 Unilateral CVA Simulation Results . . . 37

A.5 Simulation Verification Results . . . 40

A.5.1 Risk Free Investor . . . 40

A.5.2 All Parts Risky . . . 43

(6)

1 Introduction

1.1 Background

Cinnober FT is a developer of financial systems for clearing of financial transac- tions. The primary function of the clearing house is to eliminate counterparty risk between the two parties of a trade. The trades most commonly handled by a clearing house are those created on exchanges. The clearing house inserts itself as the counterparty to both the seller and the buyer. The clearing house calculates a risk margin value that both parts of the trade have to post as col- lateral while the trade is being cleared. If one part involved in the trade fails to fulfill their obligation, the clearing house can take this collateral and settle with the other part of the trade.

However, if you are trading outside the exchange, on the so called over the counter market (OTC), a clearing houses may not be involved. This means that you are directly exposed to the credit risk of your counterparty.

The goal of the thesis is to investigate and implement credit risk models. The completed implementation will rely on a sound theoretical framework comple- mented with recognized best practices and be possible to run on top of actual market data such as CDS spreads.

1.2 Counterparty Credit Risk

The financial risk is normally divided into smaller parts. One important part is the counterparty credit risk or just counterparty risk, but to be able to explain counterparty risk, there are two other parts of the financial risk that have to be explained.

Credit risk can be explained as the risk that a debtor is unable or unwilling to make a payment to fulfill contractual obligations. This is generally known as a default.

Market risk is the risk of losses in positions arising from movements in market prices. If it is linear, it arises from an exposure to the movements of underlying variables such as stock prices and credit spreads. This risk can be eliminated by entering into an offsetting contract.

Counterparty risk represents a combination of market risk, which defines the exposure and the credit risk, which defines the credit quality of the counterpart, (Gregory, 2012).

Counterparty risk is of major importance in over the counter derivatives because the counterparty risk is mitigated in exchange traded derivatives, (Mosegard Svendsen, 2014).

1.3 Over-The-Counter

The over-the-counter (OTC) market is the off-exchange market and the largest difference from the exchange market is that the participants of a trade are directly exposed to the credit risk, the risk of a default of the counterpart. When trading on the exchange, a clearing house act as a middle part and eliminates the credit risk and make sure that the trade goes through by taking collateral, a fee depending on how risky every part of the trade is.

(7)

1.4 Credit Default Swap

The credit default swap (CDS) is an agreement between two parties to exchange the credit risk of a reference entity, (Beinstein and Scott, 2006). The CDS can easiest be explained as an insurance but there are differences between an insurance and a CDS. The largest difference is that the CDS buyer does not need to own what he/she insure. This means that by buying a CDS, you could insure someone else’s property.

The buyer of the contract, pays regular payments to the seller of the contract.

In the case of a credit event for the reference entity, the payments stop and the seller of the CDS pays a large amount to the buyer. If the contract expires, the seller has received regularly payments and does not need to pay anything back.

Figure 1: The credit default swap consists of three parts, the protection buyer, the protection seller and a reference entity.

1.4.1 Credit event

The trigger of the CDS contract is called a credit event. These are a few possible credit events, explained by (Beinstein and Scott, 2006):

• Bankruptcy: Includes insolvency, creditor arrangements and appoint- ment of administrators.

• Failure to pay: When a payment on one or more obligations fails after any grace period.

• Restructuring: Refers to a change in the agreement between the refer- ence entity and the holder of the obligation due to the deterioration in creditworthiness or financial condition to the reference entity. This with respect to reduction of interest or principal, postponement of payment of interest or principal, change of currency and contractual subordination.

(8)

1.4.2 Settlement

Let us assume that an investor is exposed to an entity through a bond and wants to hedge the default risk of the entity. Then the investor can buy a CDS with this entity as the reference.

If the reference entity defaults before the maturity of the CDS, then the in- vestor of the CDS will receive a single default payment from the seller of the contract. This is called settlement. The settlement is usually physical or in cash.

If the settlement is physical, the investor deliver the bond to the seller of the CDS in exchange for a payment equal to the face value of the bond.

If the settlement is in cash, the investor receives a payment of the difference between the face value and the market value of the bond.

1.4.3 The Usage of CDS Contracts

There are several different application for credit default swaps.

Let us assume that there are three companies, named A,B and C.

In this first example, company A is lending company B $1 million and will return 10% of interest per year. Company A wants to insure the loan and buys a CDS from company C with company B as reference entity. Company A pays 1% of the loan to company C in exchange for an insurance against a default of company B, see Figure 2. In the event of a default of company B, company C will compensate company A for the loss. If company B would have defaulted without the CDS, company A would not get the money back.

Figure 2: Example 1 to the left and example 2 to the right.

In this second example, company A suspects that company C will default in the near future and buys a CDS from company B with company C as the reference entity. Company A pays periodic payments to company B and receives a default

(9)

payment in the case of a default of company C, see Figure 2. This is the same thing as buying an insurance on someone else’s car and hoping that the car will suffer an accident.

In this last example, company A is a pension fund that wants to invest their money. The problem is that they can only lend their money to someone with a very high credit rating. Let us assume that company B wants to borrow the money from company A but the credit rating of company B is too low. In this case, company A can buy a CDS from company C with company B as the reference entity. Lets assume that the credit rating for company C is the highest possible. Then company A would lend their money to company B and company C will compensate company A in the case of a default of company B, see Figure 3. The result of this example is that company A will lend their money to company B which now have the credit rating of company C.

Figure 3: Example 3.

1.5 Regulations

Too big to fail is a concept that can be explained as when a company is so essential to the economy in the world, the government will bail them out in case of bankruptcy to prevent a global economic disaster. Trading with one of these companies was considered risk free but the latest financial crisis in 2008 and the bankruptcy of Lehman Brothers showed that no investments are risk free.

The Basel accords were constructed to reduce the banks’ market and credit risk exposure. The framework of Basel I mainly focuses on credit risk. Basel II was more risk aware and was based on three pillars. Minimum capital require- ments, supervisory review and the market discipline. Basel II was implemented in the middle of the financial crisis at 2008 but before it was completely imple- mented, Basel III began to develop. This lead to the fact that Basel II never reached its full potential.

Basel III was implemented after the financial crisis and focuses mainly on the

(10)

risk of a bank run and requires larger capital reserves by the banks. One of the parts that were added to the total counterpart credit risk capital charge in Basel III is the credit valuation adjustment capital charge (CVA capital charge).

(Norman and Chen, 2013).

The purpose of the CVA capital charge is to capitalize the risk of future changes in CVA. Every new accord comes with harder regulations and that trend will probably continue.

1.6 Credit Valuation Adjustment

CVA is the difference between the risk free portfolio value and the true portfolio value that includes the possibility of a counterpart default. In other words, CVA is the market value of counterpart credit risk, (Pykhtin and Zhu, 2007).

1.7 Right and Wrong Way Risk

Right and wrong way risk is a concept that comprises a correlation between the default risk of a counterpart and the value of the underlying contract. Wrong way risk occurs in the case of a positive correlation and right way risk with a negative correlation.

When the default risk of the counterpart increases at the same time as the value of the contract increases, the wrong way risk will increase the CVA. The right way risk is the opposite, with an increasing default risk and a decreasing value of the contract, the CVA will decrease.

One example of wrong way risk is then a company sells a put option, the right but not the obligation, to sell the companies own stock. When the stock price de- creases, the value of the put option increases. When the stock price decreases, the default risk of the company increases. (Hoffman, 2011) and (Milwidsky, 2011).

(11)

2 Theory

This section consists of three parts. The first part describes the parts of the credit default swap and the valuation of the contract. The second part describes the theory behind the hazard rate and the corresponding survival probability.

The final part gives the theory behind bilateral credit valuation adjustment.

This involves simulation of an intensity model, correlation of defaults and val- uation of the bilateral credit valuation adjustment.

2.1 Credit Default Swap

The theory in this section is based on (Brigo and Mercurio, 2006).

A credit event of the referent will from now be denoted as a default and the three parts of the contract will be denoted as:

• 0 = Investor, the part that calculates the CVA

• 1 = Reference entity

• 2 = Counterpart, the part that the CVA is calculated on

The default time is denoted by τi where the index i = 0,1,2 represents the different parts of the contract. The protection buyer pays regular payments at the rate of S, the spread, at the predetermined times Ta+1, Ta+2, ..., Tbuntil the contract expires or until a default of the reference entity occurs.

In exchange, the protection buyer receives a payment of the loss given default (LGD) on the notional at a default of the reference entity. The LGD can obtain a maximum value of 1 when the full notional is paid and a minimum value of 0 when nothing is paid.

2.1.1 Premium Leg

The value of the premium leg is the present value of the payments that is made by the protection buyer, (Cojocaru and Militaru, 2014).

With the assumption that the stochastic discount factor D(s, t) is independent of the default time τ1for all 0 < s < t, the value of the premium leg at time 0 of the CDS can be defined as:

PremiumLega,b(S) = ED(0, τ1)(τ1− Tγ(τ1)−1)S1{Ta1<Tb}+ +

b

X

i=a+1

ED(0, TiiS11≥Ti}

= S Z Tb

t=Ta

P (0, t)(τ1− Tγ(τ1)−1)Q(τ1∈ [t, t + dt))

+S

b

X

i=a+1

P (0, TiiQ(τ1≥ Ti)

= −S Z Tb

t=Ta

P (0, t)(τ1− Tγ(τ1)−1)dtQ(τ1≥ t)

+S

b

X

i=a+1

P (0, TiiQ(τ1≥ Ti)

(1)

(12)

where αi is the year fraction between Ti−1and Ti, Tγ(τ1)−1 is the last payment date before τ1, P (0, t) is the zero coupon bond observed from the market that discounts the payments back from time t to 0 and Q(τ1 ≥ T ) is the survival probability. τ1represents the default time of the reference entity.

The integral term represent the accrued premium which is the fraction of the premium that has accrued from the preceding payment date up to the default time and the summation term represents the discounted payments, (O’Kane and Turnbull, 2003).

2.1.2 Protection leg (Payment Leg)

The value of the protection leg is the present value of the amount that the pro- tection buyer receives in the case of a default of the reference entity, (Cojocaru and Militaru, 2014).

With the assumption that the default time τ1 and the interest rates are inde- pendent, the value of the protection leg at time 0 of the CDS can be defined as:

ProtecLega,b(LGD) = E1{Ta1≤Tb}D(0, τ1)LGD

= LGD Z Tb

t=Ta

P (0, t)Q(τ1∈ [t, t + dt))

= −LGD Z Tb

t=Ta

P (0, t)dtQ(τ1≥ t))

(2)

2.1.3 Credit Default Swap Payoff

By again assuming that the default time and the interest rates are independent and that the recovery rate is deterministic, the value of a CDS contract to the seller at time t is given by:

CDSa,b(t; S) = PremiumLega,b(t; S) − ProtecLega,b(t; S) (3) (Milwidsky, 2011). To obtain the value of the CDS to the protection buyer, the signs in front of the legs is switched.

Given a CDS contract at time 0 for a default of the reference entity between time Ta and Tb, with the periodic premium rate S1 and the loss given default LGD1, the value of the CDS to the protection seller is given by:

CDSa,b(0, S1, LGD1) = S1

"

− Z Tb

t=Ta

P (0, t)(t − Tγ(t)−1)dtQ(τ1≥ t)

+

b

X

i=a+1

P (0, TiiQ(τ1≥ Ti)

#

+LGD1

"

Z Tb t=Ta

P (0, t)dtQ(τ1≥ t)

# (4)

where γ(t) is the first payment in period Tj following time t.

We now denote

NPV(Tj, Tb) := CDSa,b(Tj, S, LGD1) (5)

(13)

the residual NPV of a receiver CDS between the times Ta and Tb evaluated at Tj, where Ta < Tj < Tb. NPV is the net present value.

Equation (5) can be written on the same form as Equation (4) but for evaluation at time Tj:

NPV(Tj, Tb) = CDSa,b(Tj, S1, LGD1)

= 1τ1>Tj

( S1

"

− Z Tb

max{Ta,Tj}

P (Tj, t)(t − Tγ(t)−1)dtQ(τ1≥ t|FTj)

+

b

X

i=max{a,j}+1

P (Tj, TiiQ(τ1≥ Ti|FTj)

+ LGD1

"

Z Tb max{Ta,Tj}

P (Tj, t)dtQ(τ1≥ t|FTj)

#) (6)

where evaluation is conditioned on the information that is available to the mar- ket at time Tj, FTj. (Brigo and Capponi, 2008).

2.2 Hazard and Survival Function

The theory in this section is based on (Rodriguez, 2010).

Let us assume that T is a continuous random variable, f (t) is the pdf, F (t) = P r {T < t} is the cdf which gives the probability of an event has occurred by duration t. The survival function is defined as the complement of the cdf:

Q(t) = P r {T ≥ t} = 1 − F (t) = Z

t

f (x)dx (7)

The survival function gives the probability that a default has not occurred until time t. The hazard rate is the instantaneous rate of default and can be defined as:

λ(t) = lim

dt→0

P r {t ≤ T < t + dt|T ≥ t}

dt (8)

The numerator gives the conditional probability of default in the interval [t, t + dt) given that a default has not already occurred, and the denominator is the width of the interval. By taking the limit of the expression and letting dt go to zero, the result obtained is the instantaneous rate of default, or the hazard rate.

According to (Sch¨onbucher, 2003), the hazard rate can be rewritten as:

λ(t) = f (t)

Q(t) (9)

This formula means that the default rate at time t is equal to the probabil- ity density function at t divided by the survival probability until time t. By combining Equation (7) and Equation (9), the hazard rate can be expressed as:

λ(t) = −d

dtlogQ(t) (10)

If we integrate the expression from 0 to t, the survival probability at time t can be written as a function of the hazard rates up to time t:

Q(t) = exp



− Z t

0

λ(x)dx



(11)

(14)

The integral is the cumulative hazard function and it can be viewed as the sum of the risks from time 0 to t:

Λ(t) = Z t

0

λ(x)dx. (12)

Given the hazard rates, the survival function can be calculated and given the survival function, the hazard rates can be calculated. The survival function gives the curve with the probability of default at different times. The hazard rate is the short time probability of default.

2.3 Credit Valuation Adjustment

The theory in this section is based on (Brigo and Capponi, 2008).

The unilateral credit valuation adjustment (UCVA) can be explained as the difference in the price for a contract with a default risk free counterpart and that with a default risky counterpart. The bilateral credit valuation adjustment (BCVA) can be explained as the difference in the price for a contract with a default risk free investor and counterpart and the price of the contract with a default risky investor and counterpart, (Hoffman, 2011). The CVA can be seen as the price of the default risk.

Let us now define long and short position for the CVA calculation.

• Long: Calculated from the buyer, on the seller of the CDS.

• Short: Calculated from the seller, on the buyer of the CDS.

2.3.1 Unilateral CVA for CDS

The unilateral credit valuation adjustment for the short position is given by:

UCVAa,b(t, S, LGD1,2)

= LGD2Et1{t<τ2≤T }P (t, τ2)NPV(τ2)]+ (13) and for the long position:

UCVAa,b(t, S, LGD1,2)

= LGD2Et1{t<τ2≤T } P (t, τ2)−NPV(τ2)]+ (14) From Equation (13), (14) and (6), it is clear that the only terms that are left to calculate are:

1τ12Q(τ1> t|Fτ2) (15) 2.3.2 Bilateral CVA for CDS

Let us define the following events:

• A = {τ0 ≤ τ2 ≤ T } Investor defaults before counterpart, both defaults before the maturity of the contract.

• B = {τ0≤ T ≤ τ2} Investor defaults before the maturity of the contract, the counterpart defaults after the maturity.

(15)

• C = {τ2≤ τ0≤ T } Counterpart defaults before the investor, both defaults before the maturity of the contract.

• D = {τ2 ≤ T ≤ τ0} Counterpart defaults before the maturity of the contract, the investor defaults after the maturity.

The bilateral credit valuation adjustment for the short position is given by:

BCVAa,b(t, S, LGD0,1,2)

= LGD2Et{1C∪DP (t, τ2) [ NPV(τ2)]+}

− LGD0Et{1A∪BP (t, τ0) [ − NPV(τ0)]+}

(16)

and for the long position:

BCVAa,b(t, S, LGD0,1,2)

= LGD2Et{1C∪DP (t, τ2) [ − NPV(τ2)]+}

− LGD0Et{1A∪BP (t, τ0) [ NPV(τ0)]+}

(17)

From Equation (16), (17) and (6), is is clear that the only terms that are left to calculate are:

1C∪D1τ12Q(τ1> t|Fτ2) (18) and

1A∪B1τ10Q(τ1> t|Fτ0) (19) The big advantage for BCVA against Unilateral CVA is that BCVA is sym- metric. The BCVA of the investor is minus the BCVA for the counterpart, (Hoffman, 2011).

2.3.3 Default Correlation

Let us assume that the defaults are correlated between the parts of the contract.

The dependence is modeled by using a trivariate Gaussian copula function. The exponential random variables that characterizes the default times are modeled with the dependence function. The default intensities λi for the parts of the contract are assumed to be independent of each other. By assuming that the cumulative intensities are strictly positive, Λi will be invertible. The default times τi can be defined as

τi= Λ−1ii), i = 0, 1, 2 (20) where ξiis a standard unit-mean exponential random variable. From the prop- erties of exponential random variables follows that

Ui= 1 − exp(−ξi) (21)

are uniform [0, 1] randomly distributed which are correlated through a Gaussian trivariate copula

CR(u0, u1, u2) = Q(U0< u0, U1< u1, U2< u2) (22) where R is a correlation matrix.

(16)

2.3.4 CIR++ Intensity Model

The stochastic intensity model that we chose for simulation of the paths for the three parties of the contract is

λj(t) = yj(t) + ψj(t; βj), t ≥ 0, j = 0, 1, 2 (23) where ψ is a deterministic function that depends on the parameter vector βj

and is integrable on closed intervals. yj is assumed to be a Cox Ingersoll Ross (CIR) process that is given by

dyj(t) = κjj− yj(t))dt + νj

q

yj(t)dZj(t), j = 0, 1, 2 (24) The parameter vectors are βj= (κj, µj, νj, yj(0)) where all components are pos- itive deterministic constants. Zj is assumed to be standard Brownian motion that are independent. One note is that the Feller condition 2κjµj > νj2 that prevent the CIR process for attending a zero value is not imposed. Instead a constraint is imposed on the deterministic shift ψ that makes it strictly positive and because the CIR process cannot become negative, the CIR++ process be- comes strictly positive and nonzero.

We also define the following integrated quantities that will be used later Λj(t) =

Z t 0

λj(s)ds, Yj(t) = Z t

0

yj(s)ds, Ψj(t; βj) = Z t

0

ψj(s; βj)ds (25)

(17)

3 Method

This section describes the method for the implementation. The first part of the implementation consists of constructing the hazard rate curve and the cor- responding survival probability curve. The second part of the implementation consists of the calculation of the bilateral credit valuation adjustment for a credit default swap.

3.1 Construction of Hazard Rate and Survival Probability Curve

The theory that the method in this section is based on comes from (O’Kane and Turnbull, 2003). To be able to calculate the hazard rate curve, there are a few input parameters that are necessary. The first are the risk-free zero rates, that are used for discounting payments. The second parameter is the recovery rate R and the third parameter is the market spreads S for a set of tenors. The model that is selected for the calculation of the hazard rates is the JPMorgan model. This model assumes that the default occurs midway during the period.

The accrued payment is made at the end of the period.

From the zero rates, the zero curve can be calculated by interpolating the zero rates and then calculate the discount factors that are needed.

For the 4Y data, the quarterly discount factors are given so we just need to do a interpolation to obtain the monthly discount factors (because the model calculates the payment leg monthly). This interpolation is done linearly.

3.1.1 Premium Leg

Lets assume that there are n = 1, ..., N contractual payment dates t1, ..., tN, where tN is the maturity date. The premium leg is defined in Equation (1) and by using the approximation given by (O’Kane and Turnbull, 2003), the premium leg can be written as:

PremiumLeg(tV, S) ≈ S(tV, tn)

N

X

n=1

P (TV, tnnQ(tV, tn)

+S(tV, tn) 2

N

X

n=1

P (tV, tnn(Q(tV, tn−1) − Q(tV, tn))

= S(tV, tn) 2

N

X

n=1

P (tV, tnn(Q(tV, tn−1) + Q(tV, tn))

(26)

where tV is the time of evaluation and accrued premium is assumed. S(tV, tn) is the spread for the corresponding payment date tnEquation (26) is the expression that we are going to use for the calculation of the hazard rates and the survival probabilities.

3.1.2 Protection leg

The protection leg is defined in Equation (2) and by using the approximation in (O’Kane and Turnbull, 2003), we will get the following expression for calculation

(18)

of the protection leg:

ProtecLeg(tV, R) ≈ (1 − R)

M ×tN

X

m=1

P (tV, tm)(Q(tV, tm−1) − Q(tV, tm)) (27)

where M is a finite number of discrete points per year. This expression will be used for calculation of the hazard rates and the survival probabilities.

3.1.3 Bootstrapping hazard rate

The spread is assumed to be break even which implies that the payment leg is equal to the premium leg. By setting Equation (26) equal to Equation (27), rearranging some terms and rewrite the probabilities in terms of the hazard rates, we get the following expression under the assumptions that the CDS have quarterly payments and monthly discretization:

S(tv, tv+ 1Y ) 1 − R

X

n=3,6,9,12

P (tv, tnne−λnτn+ e−λnτn−3 2

=

12

X

m=1

P (tv, tm)(e−λmτm−1− e−λmτm)

(28)

where τn and τmare discretization factors:

τ0= 0.0, τ1= 0.0833, τ2= 0.167, ..., τ12= 1.00 (29) The only unknown terms in Equation (28) is the hazard rate which can be solved for the first period by using a root finder such as Newton-Raphson. When the hazard rate for the first period is solved, this rate can be used for solving the hazard rate for the next period. The hazard rate for the first in combination with the hazard rate for the second period is then used for calculation of the hazard rate for the third period. This procedure is repeated until all hazard rates are solved. The procedure is called bootstrapping. The hazard rate is assumed to be constant over the periods and therefore piecewise constant over the whole time period. Notice that larger intervals reduces the accuracy but decreases the number of calculations needed.

(19)

Figure 4: Example of the piecewise constant hazard rate.

The calculated hazard rates can then be used to calculate the credit valuation adjustment for the CDS.

3.1.4 Survival probability

Given the piecewise constant hazard rates, the survival probabilities can then be calculated by:

Q(τ ) =









exp(−λ0,0.5τ ) if 0 < τ ≤ 0.5

exp(−0.5λ0,0.5− λ0.5,1(τ − 0.5)) if 0.5 < τ ≤ 1 exp(−0.5λ0,0.5− 0.5λ0.5,1− λ1,3(τ − 1)) if 1 < τ ≤ 3 exp(−0.5λ0,0.5− 0.5λ0.5,1− 2λ1,3− λ3,5(τ − 3)) if 3 < τ ≤ 5

(30)

3.2 CVA for CDS

The theory that this method is based on (Milwidsky, 2011) and (Brigo and Capponi, 2008). There are four main steps in the calculation of CVA for a CDS. Figure 5 shows the procedure for the calculation, step by step. The first step is to calibrate the parameters that will be used in the simulation of the intensities. The second step is to simulate default times for all parts of the contract. The next step is to valuate the CDS contract and the last step is to calculate the CVA given the values of the contract in each scenario.

(20)

Figure 5: Flow chart of the calculation of CVA, (Milwidsky, 2011).

3.2.1 Calibration of CIR++ Process

The first step for calculation of the BCVA is to calibrate the CIR++ parame- ters to the market data. The deterministic function ψ is given by (Brigo and Mercurio, 2006):

ψ(t, β) = λ(t) − fCIR(0, t) = fM(0, t) − fCIR(0, t) (31) where fM(0, t) are the hazard rates that are obtained from the market calibra- tion and fCIR(0, t) is the instantaneous forward rate for the CIR process which is given by:

fCIR(0, t) = 2κµ eth− 1

2h + (κ + h)(eth− 1) + y0

4h2eth

[2h + (κ + h)(eth− 1)]2 (32) where

h =p

κ2+ 2ν2 (33)

To obtain the CIR++ parameters, (µ, κ, y0, ν), we want to minimizeRT

0 ψ(s, β)2ds.

There are however some restrictions:

• All CIR++ parameters have to be positive.

• The integral Ψ(t, β) have to be positive.

• The integral Ψ(t, β) have to be increasing.

(21)

3.2.2 CIR++ Simulation

When the CIR++ parameters are known, we can start simulating paths for the CIR++ process. (Brigo and Capponi, 2008) gives an expression for calculating the next value of the simulated path, y(t), that we are going to use, given the CIR++ parameters and the previous value, y(u):

y(t) = ν2(1 − e−κ(t−u)) 4κ χ0d2

 4κe−κ(t−u) ν2(1 − e−κ(t−u))y(u)



(34) where

d =4κµ

ν2 (35)

According to (Glasserman, 2003), we can rewrite the non-central chi distribution χ0ν2(λ) as:

χ0ν2(λ) = (Z +√

λ)2+ χ2ν−1(λ) (36)

where Z ∼ N (0, 1) and χ2ν−1(λ) is the ordinary chi distribution. (Glasserman, 2003) also propose an algorithm for the simulation of the paths shown in Figure 6.

Figure 6: The algorithm for simulating paths of the CIR process provided by (Glasserman, 2003).

Notice that according to Equation (23) that the shift ψ have to be added to the simulated path of the CIR process to obtain the intensities.

(22)

3.2.3 Conditional Survival Probability

(Capponi, 2009) defines the conditional survival probability in the unilateral case as:

1τ12Q(τ1> t|Fτ2) = 1A+ 1τ2<t1τ12

Z 1 U1

FΛ1(t)(−log(1 − u1))dC1|2(u1; U2) (37) and (Brigo and Capponi, 2008) defines the conditional survival probability in the bilateral case for a counterpart default as:

1C∪D1τ12Q(τ1> t|Fτ2) = 1τ2≤T1τ2≤τ0 1A+ 1τ2<t1τ1≥τ2

Z 1 U1,2

FΛ1(t)−Λ12)(−log(1 − u1) − Λ12))dC1|0,2(u1; U2)

!

(38) and for an investor default as:

1A∪B1τ10Q(τ1> t|Fτ0) = 1τ0≤T1τ0≤τ2 1B+ 1τ0<t1τ1≥τ0

Z 1 U1,0

FΛ1(t)−Λ10)(−log(1 − u1) − Λ10))dC1|2,0(u1; U0)

!

(39) FΛi is the cumulative distribution function of the intensity process for part i, which is the CIR process plus the shift.

The integral in Equation (38) can be approximated as:

Q(τ1> Tk|Fτi, τ1> τi) ≈X

j

pj+1+ pj

2 ∆fj (40)

In the unilateral case, the function fj can be written as:

fj = C1|2(uj, U2) (41)

In the bilateral case, in the case of a counterpart default, the function fj can be written as:

fj = C1|0,2(uj, U2) (42)

and in the case of a investor default, fj can be written as:

fj = C1|2,0(uj, U0) (43)

The function pj is the cumulative distribution function of the intensity process.

3.2.4 Fractional Fast Fourier Transform

By using the inversion of the characteristic function of the integrated CIR pro- cess with a Fourier transform, the CDF of the integrated CIR process can be calculated as:

F (x) = P (X ≤ x) = 2 π

Z 0

Re(φ(u))sin(ux)

u du (44)

(23)

where X is a non-negative random variable and X = Y1k) − Y1i). One method for numerical calculation of the integral is the Trapezoidal rule which is defined as:

Z b a

f (x)dx ≈ b − a 2N

N −1

X

j=0

(f (xj) + f (xj+1)) (45) Because the integrand will die out to zero, we just need to make sure that the upper limit is large enough. By applying the Trapezoidal rule to Equation (44), the CDF can be calculated as:

2 π

Z 0

Re(φ(u))sin(uxk) u du ≈ 2

π b − a

2N

N −1

X

j=0

Re(φ(uj))sin(ujxk) uj

δwj (46)

where the weights wj are:

w0= 1, w1= 2, w2= 2, ..., wN −2= 2, wN −1= 1.

If we assume that the step size for x is λ, the CDF can be calculated from:

δ π

N −1

X

j=0

Re(φ(δj))sin(δjλk)

δj wj (47)

The characteristic function φ is defined as:

φ(u) = eκ2µt/ν2e2y0iu/(κ+γcoth(γt/2))

(cosh(γt/2) + κsin(γt/2)/γ)2κµ/ν2 (48) where γ is:

γ =p

κ2− 2ν2iu (49)

There is a problem when we want to integrate this function. The integrand will have discontinuities and these comes from the denominator of the characteristic function. By factor the eγt/2term out of the denominator of Equation (48), the discontinuity will disappear. The modified characteristic equation can then be written as:

φ(u) = e(κµtν2(κ−γ))e(κ+γcoth(γt/2)2y0iu )

[12(1 +κγ + e−γt(1 −κγ))]2κµ/ν2 (50) The integral in Equation (44) have a lower limit of 0 which gives a problem.

The integrand:

Re(φ(u))sin(ux)

u (51)

is undefined at u = 0 which comes from that sin(ux)u is undefined. This can however be solved by applying L’Hˆopital’s rule to the equation. This will give the equation:

lim

u→0+

sin(ux)

u = x (52)

and because the characteristic equation is 1 when u = 0, we have:

lim

u→0+Re(φ(u))sin(ux)

u = x (53)

(24)

3.2.5 Conditional Gaussian Copula Function

In the unilateral case the conditional copula function is given by:

C1|2(uj, U2) = Q(U1< uj|U2) − Q(U1< U1|U2) 1 − Q(U1< U1|U2)

=

∂C1,2(u1,u2)

∂u2

u

2=U2∂C1,2∂u(U1,u2)

2

u

2=U2

1 − ∂C1,2∂u(U1,u2)

2

u

2=U2

(54)

where the inputs are defined as:

U1= 1 − eΛ12) (55)

U2= 1 − eΛ22) (56)

uj= 1 − e−xj−Y12)−Ψ1(Tk) (57) In the bilateral case the conditional copula function is given as:

C1|0,2(uj, U2) =

∂C1,2(uj,u2)

∂u2

u

2=U2

∂C(U0,2∂u,uj,u2)

2

u

2=U2

∂C1,2(U∂u1,2,u2)

2

u

2=U2

+ ∂C(U0,2∂u,U1,2,u2)

2

u

2=U2

1 − ∂C0,2(U∂u0,2,u2)

2

u

2=U2∂C1,2(U∂u1,2,u2)

2

u

2=U2

+ ∂C(U0,2∂u,U1,2,u2)

2

u

2=U2

(58) for a counterpart default and:

C1|2,0(uj, U0) =

∂C0,1(u0,uj)

∂u0

u

0=U0

∂C(u0∂u,uj,U2,0)

0

u

0=U0

∂C0,1(u∂u0,U1,0)

0

u

0=U0

+ ∂C(u0,U∂u1,0,U2,0)

0

u

0=U0

1 − ∂C0,2(u∂u0,U2,0)

0

u

0=U0∂C0,1(u∂u0,U1,0)

0

u

0=U0

+ ∂C(u0,U∂u1,0,U2,0)

0

u

0=U0

(59) for a investor default.

The inputs required are defined as:

Uj,i= 1 − eΛji) (60)

Ui= 1 − eΛii) (61)

uj= 1 − e−xj−Y1i)−Ψ1(Tk) (62) The derivation of the conditional copulas can be found in Appendix.

We assume that the correlation matrix is given by:

Σ =

1 ρ0,1 ρ0,2 ρ1,0 1 ρ1,2

ρ2,0 ρ2,1 1

=

σ11 σ12 σ13 σ21 σ22 σ23

σ31 σ32 σ33

(25)

To be able to calculate the conditional copula function there are two different survival probabilities that have to be calculated. The first term is:

Q(U1< uj|U2) = ∂C1,2(uj, u2)

∂u2

u

2=U2

(63)

This can be calculated by using the univariate normal cumulative distribution function at the point Φ−1(uj). The mean and variance is given by:

µcond= ρΦ−1(U2) and

varcond= (1 − ρ2)

Φ−1 is the inverse of the the standard normal cumulative distribution function and ρ is the correlation. In this example the correlation is between 1 and 2 which represents the reference entity and the counterpart.

The second term is:

Q(U0< u0, U1< u1|U2) = ∂C(u0, u1, u2)

∂u2 u

2=U2

(64)

This can be calculated by using the bivariate normal cumulative distribution function with mean 0 and covariance matrix Σ at the point [Φ−1(u0), Φ−1(u1)].

The conditional covariance Σ is defined as:

Σ = Σ11− Σ12Σ−122Σ21 (65) For the calculation of Equation (64), the correlation parameters are given by:

Σ11=σ11 σ12

σ21 σ22



, Σ12=σ13

σ23



, Σ12= σ31 σ32 , Σ22= σ33

If we instead wants to calculate the probability of an investor default Q(U1< u1, U2< u2|U0) = ∂C(u0, u1, u2)

∂u0 u0=U

0

(66)

the correlation parameters are given by:

Σ11=σ22 σ23

σ32 σ33



, Σ12=σ21

σ31



, Σ12= σ12 σ13 , Σ22= σ11

and the bivariate cumulative distribution function is evaluated at [Φ−1(u1), Φ−1(u2)]

instead.

(26)

4 Results

This section presents the results from the three different implementations ex- plained in the method. The first implementation consists of bootstrapping the piecewise constant hazard rates from the given market spreads of a CDS and then calculating the survival probabilities. The second implementation consists of calculating the CVA for a CDS in the unilateral case, which means that one part is seen as risk free. In the third and last implementation, the CVA for a CDS is calculated but in this case, all parts are considered default risky. 1

4.1 Survival Curve Construction from Market Spreads

The survival curve construction implementation was made on two different sets of market spreads. The data that was needed for the implementation is pre- sented in Appendix A.2 CDS Data. The results from the implementation con- sists of a hazard rate for every tenor and a corresponding survival probability.

The hazard rates are assumed to be piecewise constant and a linear interpolator was used to obtain the discount curve and the survival probability curve.

The captions in Table 1 and Table 2 are the following:

• Tenor: Time until the CDS expires.

• Hazard: The hazard rates calculated from the market spreads.

• Implementation: The survival probabilities calculated from the hazard rates.

• Article: The survival probabilities given by the article.

• Matlab: The survival probabilities calculated in Matlab from the market spreads and the zero curve.

• Error: The percentage error between the implemented survival probabil- ities and the survival probabilities given by the article.

The results from the first set of spreads are presented in Table 1.

Table 1: Results from implementation of the 4Y data.

Tenor Hazard Implementation Article Matlab Error

6M 0.01665 0.99148 0.99150 0.99148 -0.002%

1Y 0.02003 0.98149 0.98164 0.98150 -0.015%

2Y 0.02171 0.96018 0.96030 0.96021 -0.012%

3Y 0.02523 0.93594 0.93616 0.93602 -0.024%

4Y 0.02897 0.90885 0.90924 0.90906 -0.043%

From Table 1 we can see that the survival probability decrease when the tenor increases. We can also see that the error is small but increasing with the tenor.

1Note that the CVA values in this report are presented in basis points and not as a spread.

(27)

Figure 7 shows the resulting survival probability curve for the first set of market spreads.

Figure 7: The survival probability curve for the 4Y data.

The results from the second set of spreads are presented in Table 2.

Table 2: Data 2

Tenor Hazard Implementation Article Matlab Error

6M 0.01319 0.99316 0.99307 0.99307 0.009%

1Y 0.01319 0.98661 0.98645 0.98644 0.017%

3Y 0.02431 0.93980 0.93915 0.93910 0.069%

5Y 0.04278 0.86274 0.86259 0.86259 0.017%

7Y 0.04482 0.78867 0.78866 0.78868 0.001%

10Y 0.04399 0.69108 0.69051 0.69054 0.082%

From Table 2 we can see that there are more and larger tenors in this case.

The survival probabilities are decreasing when the tenors are increasing. The trend of the error is the same as in the previous implementation but with a few exceptions. Figure 8 shows the resulting survival probability curve for the second set of market spreads.

(28)

Figure 8: The survival probability curve for the 10Y data.

4.2 Unilateral CVA

In this section, the behavior of the unilateral CVA for a 5 year CDS with quar- terly payments is presented. The results come from simulations and by averaging the replacement costs, which is the values of the contract at default, of 10 000 scenarios. The CIR++ parameters that have been used is presented in Table 12 in Appendix A.3. Notice that these parameters are given by (Milwidsky, 2012) and are not calibrated from market data in this implementation. Three different cases are considered where the level of riskiness is altered for the counterpart and the reference entity. In every case, the reference entity volatility (ν1) and the correlation (ρ) is varied to find the behavior of the CVA2. The volatility for the counterpart (ν2) is assumed to be 0.1 for every case and the LGD for every part is assumed to be 75%.

In the first case, the reference entity is assumed to be at low risk and the counterpart at high risk. In Figure 9, the behavior of the unilateral CVA values are shown.

Figure 9 shows that the CVA for the long position increases when the correla- tion increases. This is expected because the long position, which is from the buyer side of the protection, the protection becomes more valuable. The price of a similar protection becomes more expensive after a default of the counter- part. When the correlation is negative, if the counterpart defaults, the reference entity is most likely to survive at least until maturity but if the correlation is positive, the reference is most likely do default as well.

For the short position, the seller side of the contract, the CVA increases for negative correlations. This is expected as well because value of the protection increases for the seller when the default risk of the reference entity decreases.

2Notice that the volatility parameter (ν1) from (Milwidsky, 2012) is not used. Instead are a few arbitrary values used.

(29)

-1 -0.5 0 0.5 1 correlation

0 100 200 300 400 500 600

CVA (bp)

Short position, v 1 = 0.05 Short position, v

1 = 0.3 Short position, v 1 = 0.6 Long position, v

1 = 0.05 Long position, v

1 = 0.3 Long position, v

1 = 0.6

Figure 9: Reference entity: low risk, counterpart: high risk.

In the second scenario,the reference entity is assumed to be at medium risk and the counterpart at low risk. In Figure 10, the behavior of the unilateral CVA values are shown.

-1 -0.5 0 0.5 1

correlation 0

20 40 60 80 100 120 140 160 180 200

CVA (bp)

Short position, v 1 = 0.05 Short position, v

1 = 0.3 Short position, v

1 = 0.6 Long position, v

1 = 0.05 Long position, v

1 = 0.3 Long position, v

1 = 0.6

Figure 10: Reference entity: medium risk, counterpart: low risk.

Figure 10 shows the same behavior as in the previous case but for low hazard rate volatilities on for the reference entity (ν1), the long position tends to decrease for high positive correlations. This happens because the counterpart has a lower level of risk than the reference entity. Because of this, the default time of the

(30)

reference entity will occur before the counterpart more often and therefore, the CVA value will be lower. When the volatility is higher, this will happen less often and there will be no decrease in CVA when the correlation increases.

In the third scenario, the reference entity is assumed to be at high risk and the counterpart at low risk. In Figure 11, the behavior of the unilateral CVA values are shown.

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1

correlation 0

10 20 30 40 50 60 70 80 90 100

CVA (bp)

Short position, v 1 = 0.05 Short position, v 1 = 0.3 Short position, v 1 = 0.6 Long position, v 1 = 0.05 Long position, v 1 = 0.3 Long position, v 1 = 0.6

Figure 11: Reference entity: high risk, counterpart: low risk.

Figure 11 shows that for higher positive correlations, the long position decreases.

The explanation for this is the same as in the previous case, but in this case, the reference entity is a lot more risky than the counterpart. For very high correlations and low hazard rate volatility, the reference entity always defaults before the counterpart which will give a zero CVA value. For higher volatilities, the CVA value will increase but there will still be a decrease in the CVA values for high positive correlations.

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

where r i,t − r f ,t is the excess return of the each firm’s stock return over the risk-free inter- est rate, ( r m,t − r f ,t ) is the excess return of the market portfolio, SMB i,t

Från den teoretiska modellen vet vi att när det finns två budgivare på marknaden, och marknadsandelen för månadens vara ökar, så leder detta till lägre

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

Detta projekt utvecklar policymixen för strategin Smart industri (Näringsdepartementet, 2016a). En av anledningarna till en stark avgränsning är att analysen bygger på djupa