Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Final Project (30 % of Grade)

March 11, 2023

IMPORTANT This is an individual assignment, you are not to communicate answers, code, or any other information with any of your classmates. Any suspicion of plagiarism will be investigated very carefully and penalized accordingly.

The purpose of this project is to Calculate Market and Credit Value at Risk (VaR) and Expected Short Fall (ES) of a portfolio of Corporate” Zero Coupon Bonds with different maturities.

We will leverage the code from Homework 04. I suggest you to copy my code if you work in Python. Note: Submit your code with the answers. (BTW. My code is in Python, but you can use R)

1    Preliminaries (0 points)

1.1    Preparing the yield curves

This is exactly the same as in Homework 04. For completeness I repeat the instructions.

1. The “US treasury.csv” file contains the time-series of annual yield term structure yt , for t =30 days,

90 days, ..., 10950 days (real = 30years). These yields correspond to the discount rate (risk free) one should use to price any instrument on a given time.

2. These yields correspond to the risk free rate one should use to price any instrument on a given time.

3. If necessary give format to dates dates (If you use python the dates should be transformed into datetime format, e.g., use the pandas.to datetime())

4. Remove dates with missing data: make sure the rows are complete and if not, remove the entire row.

1.2    Calibrate the Ornstein Uhlenbeck

Using the Homework 04’s code.

1. Estimate the OU parameters θ,κ,σ for each node (30, 90, . . . ).

2. Estimate the correlation of the OU parameters ρij  for each node.

3. Make sure you are able to simulate multivariate OU processes as we did in the previous homework.

1.3    Upload the Transition Matrix

File “TransitionMatrix.csv” contains the 1 year transition probability matrix for different credit ratings (see Table 1).  Here,“AAA”is a better rating (lower prob of default) than“BBB+”, which in turn is better than“BB”, which is better than“CC”and so on.

The rows in Figure 1indicate the initial (or starting) state and columns indicate the final state (or landing state).

 

Figure 1: Transition Matrix

For example, the probability of being downgraded from“BBB+” to a“BB”credit rating in one year is P[Rt+1  = BB|Rt  = BBB+] = 0.0036 = 0.36%.

Note: Each row adds up to one.

1.3.1    Simple Monte Carlo simulation for credit transitions

Say that the initial state (initial rating) is A+, then the transition probability to any state (including staying in the same state) in one year as in Figure 2

 

Figure 2: Transition probabilities from A+ to any state.

Thus to simulate the transitions from state A+ to any state (including staying in the same state) in one year proceed as follows:

0.- Compute the cumulative transition probabilities as in Figure 3.

 

Figure 3: Cumulative transition probabilities from A+ to any state.

These one-year cumulative probabilities (cp) generates the thresholds [0 = cp0 , cpAAA], (cpAAA , cpAA+], . . . , (cpC , cpDefault  = 1] for each of the credit ratings available.

1.- Simulate a uniformly distributed random variable U ∼ U(0, 1),

2.- The landing state is determined by the state s such cps −  < U ≤ cps , i.e., s = inf{x : cp −  < U ≤ cp }.

For example, assume the initial state is A+, also assume that the uniformly distributed r.v. is U = 0.97, then the landing state is s =“A − ”since 0.9534 = cpA  < U ≤ cpA = 0.9809.

1.4    Upload the Credit Spreads

File “credit spreads.csv” contains the credit spreads (annual rates) that need to be added to the risk free rate in order to compensate for possibility of default of the counterparty.  The lower the credit rating, the more likely the bond issuer will default, and hence the higher the credit spread. Figure 4 shows the credit spreads for each maturity, Figure 5 displays the corresponding term-structure.

 

Figure 4: Credit Spreads

 

Figure 5: Credit Spreads Term Structure

To simplify this project, we assume that the credit spread term structure remains constant.  That is, today the credit spread of a BBB bond with 2 year maturity is 0.1902% (continuously compounded), while 1 year from now another BBB bond that also matures in 2 years (i.e., 3 years from now) also has 0.1902% credit spread.

In general, the value of a corporate zero-coupon bond maturing in one year with $100 face value is given by (this is a simplified version of Recovery from Treasury, which we will use for this project)

B(t,tM ,Rt ,ϱ) = 100eyt M      (1{τ>t}P [1{τ>tM }] + ϱ (1 1{τ>t}P [1{τ>tM }]))     = 100eyt M       ( 1{τ>t}e st M(Rt)      + ϱ ( 1 1{τ>t}e st M(Rt)    ))

where t ≥ 0 is the current time (or the time of valuation), TM   > t is the maturity time, Rt  is the credit rating of the bond at time t (at time of valuation), ϱ ∈ [0, 1] is the recovery rate (% of notional received at maturity if the bond has defaulted by time TM ), yTM    is the yield rate (risk free) for a bond maturing at time TM , and stM(Rt)    is the credit spread used to discount a bond maturing at time TM  which as credit rating Rt  at time t.

For example, consider that today is 2022/07/25, the risk free rate is y365  = 3.07427% and y730  = 3.04885% (see the “US treasury.csv” file).

.  The present value of a BBB+ bond maturing in two years TM  = 730, which pays 70% of notional if the bond defaults is given by (here 1{τ>0} = 1 since it has not yet defaulted at t = 0),

B(t = 0,tM  = 730,Rt  = BBB+,ϱ = 0.7) = 100e0 .0304885(730/365)

× (1 · 0 .001293(730/365) + 0.7 (1 1 · 0 .001293(730/365)))

= 94.011588

•  The value of the same bond 1 year from today in today’s dollars if in one year the bond’s credit rating did not change is (here 1{τ>365}  = 1 since it has not yet defaulted by time t = 365), and the interest rates remain constant,

B(t = 365,tM  = 730,Rt  = BBB+,ϱ = 0.7) = e0 .03074272(365/365) ( 100e0 .03074272(365/365)

× ( 1 · 0 .001124(365/365) + 0.7 ( 1 1 · 0 .001124(365/365))))

= 94.004975

•  Similarly, the value of the same bond 1 year from today in today’s dollars if in one year the bond’s credit rating changes to Default” is (here 1{τ>365} = 0 since it has already defaulted before or at time t = 365), and the interest rates remain constant,

B(t = 365,tM  = 730,Rt  = Default,ϱ = 0.7) = e0 .03074272(365/365) ( 100e0 .03074272(365/365) (0 + 0.7(1)) )

= 65.82566

2    Transition Probabilities (10 points)

Using the transition probability matrix provided, please answer the following.

2.1    Questions

1. What is the probability that in three years the credit rating of a“BB”bond becomes“C”?

2. What is the minimum number of years needed such that the probability of default of a A is greater than 1%? That is, what is n* = inf{n 0 : P[Rn  = Default|R0  = A] ≥ 1%}?

3. In general, a (long term) bond which has a rating BBB or better, is considered an investment grade bond, while a bond with a rating lower than BBB  is considered a high  yield  bond.   What is the probability that a B becomes an investment grade bond in 4 years?

Hint: The answers for 1 and 3 are a number between 0.05% and 1.5%.

3    Pricing Corporate Bonds (10 points)

Assume that today is 2022/07/25 and you hold three corporate zero-coupon bonds (three long positions):

a) A bond maturing in 1095 days (3 years) from now and pays $100 at maturity. The current credit rating is B+ and, in case of default the recovery rate is 70%.

b) A bond maturing in 1825 days (5 years) from now and also pays $100 at maturity. The current credit rating is A − and, in case of default the recovery rate is 60%

c) A bond maturing in 3650 days (10 years) from now and also pays $100 at maturity. The current credit rating is AA and, in case of default the recovery rate is 50%

Note:  In what follows, for simplicity, we do  not consider intermediate transitions, nor we discount according to intermediate states. That is, we only consider the final credit rating as seen at the end of the period. For example, a bond that changed from AAA to A in one year, may have changed from AAA to AA in 3 months and then from AA to A in 4 months and remain in A until the end of the year.  However, we only consider the final state A to adjust the credit spread in one year.

3.1    Questions

1. What is the value of each bond today (for your benefit, so you can verify whether you got the right answer, the portfolio today is $251.3696)?

2. What is the value of each bond in a year (365 days) from today in todays dollars, if the bonds do not change credit ratings (for your benefit, so you can verify whether you got the right answer, the portfolio in today’s dollars is $251.351)?

3. What is the value of each bond in a year (365 days) from today in todays dollars, if the bonds changed their credit ratings as follows B+ → BB , A− → Default, and AA AAA, respectively? Also, what is the value of the portfolio (in today’s dollars)?

4    Value at Risk and Expected Shortfall (10 points)

Consider the portfolio of the previous section. Assuming that you are interested in 2 years time-horizon for your analysis, i.e., 730 days in the future. Compute 25,000 Monte Carlo simulations of both, interest rates and credit ratings, to answer the following questions.

Note: Simulation may take a long time, so I recommend you to run with small number of scenarios say 1000 to test your results, and once you are satisfied run the 25,000 scenarios (otherwise it will be painful to debug).

Hint:  Compute the 2 year transition matrix.  Then use the Algorithm described in section 1.3.1 to compute the state where each of the firms transition to in 2 years.  We are assuming that the transitions are independent of the interest rates. Thus, in principle, you can simulate the interest rates independently of the transitions.  In fact, we are assuming that the credit transitions are also independent among bonds, since we are simulating independent uniformly distributed random variables in the Algorithm described in section 1.3.1.  Hence, after your simulated the 25,000 Monte Carlo interest rate scenarios and the 25,000 Transitions (for each firm) you can combine the simulations to price the corporate bonds under each scenario. Alternatively, you can do the simulation of credit states and interest rates simultaneously (which is how I do it).

Remark:  Although we are not doing for this project, if you want to introduce correlation on defaults and credit migrations you can achieve it by simulating correlated uniformly distributed random variables (via copulas).

4.1    Questions

1. Compute 25,000 Monte Carlo simulations to answer the following questions.

Hint:  Just as in Homework 04, you don’t need to simulate all nodes, and you don’t need to simulate daily increments.  Recall also, that you need to discount the values to today’s dollars since the time-horizon is long.

(a) What is the 2 years VaR at 99% confidence (express it in terms of losses in relation to today’s

value, i.e., Question 3.1.1)?

(b) What is the 2 years ES at 99% confidence (express it in terms of losses in relation to today’s

value, i.e., Question 3.1.1)?