Sie sind auf Seite 1von 24

Contents

I. Introduction............................................................................................................................................... 1
II. Liability Analysis ....................................................................................................................................... 2
III. Bond Selection......................................................................................................................................... 4
1.

Constraint ......................................................................................................................................... 4

2.

Assumptions ..................................................................................................................................... 4

3.

Ways to find the optimal bond portfolios ....................................................................................... 4

4.

Liability analysis revisit .................................................................................................................... 5

5.

Portfolio Optimization (selecting the bonds we will invest) .......................................................... 6

6.

Putting Assets, Liabilities and Gap together ................................................................................... 8

IV. Market and Credit Risk Assessment ..................................................................................................... 10


1.

Market Risk Assessment ................................................................................................................ 10

2.

Credit Risk Assessment .................................................................................................................. 12

V. Final Portfolio Selection ......................................................................................................................... 15

I. Introduction
In the report we first analyzed our potential liability in 2017 and 2018 under the assumption that our
required return will follow a normal distribution with a mean of 3.5% and a standard deviation of 2%.
We simulated the potential paths of the liability in the next four and five years, and visualized the
potential outcomes by plotting the liability distribution in 2017 and 2018.
We then started our bond selection process. We first set up our constraints and assumptions for the
selection process, and then we optimized our bonds portfolio under two different goals:
(1) minimize cumulative gap standard deviation
(2) maximize mean of cumulative gap.
We think cumulative gap is more meaningful than single-year gap because we more care about
whether we have enough money to repay the debt holder than whether our bonds mature in a
specific year can cover that years liability.
We used MATLAB fmincon function to solve for our optimal portfolios. We selected one optimal
portfolio from the minimizing standard deviation method, and selected another optimal portfolio from
the maximizing mean method.

To make the final decision regarding which portfolio is better, we further applied market risk and credit
risk assessment to our portfolios. By analyzing the interest sensitivity of the gaps as well as the credit
VaR, we determined that the portfolio which minimize cumulative gap standard deviation is the best
portfolio.

II. Liability Analysis


The current net accrued premium from the portfolio of annuities Janets group manages is $300 million.
Benefit payments for this portfolio of annuities will begin 4 years from now in 2017. We also know that
annuities will grow tracked by a bond index, whose annual yield is assumed to be normally distributed
with an expected annual yield of 5% and an annual standard deviation of 2%. Moreover, JH annuity
benefits will be determined by tracking the annual yield from the bond index with a margin of 1.5%. We
use as the annual rate of return for annuities.

So at the end of 4th year, 40% of the projected portfolio worth will be paid in benefits for the annuities
can be described as equation (2).

In the same way, we can get the payments in 5th year shown in equation (3).

We can get the paths of portfolio in Figure 1 and Figure 2. Figure 1 is the portfolio paths in each year
without taking out the benefits. Figure 2 is the portfolio paths after taking out the benefits.
8

4.2

x 10

Figure 1 Portfolio Value Paths Before Taking out Benefits

Portfolio Value

3.8

3.6

3.4

3.2

2.8

3
Year

x 10

Figure 2 Portfolio Value Paths After Taking out Benefits

Portfolio Value

3.5

2.5

1.5

Year

So we can get the distributions of payments in 4th and 5th year, which are shown in Figure 3.

On the left side of Figure 3 is the distribution of payments in 4th year, the mean of the payments is
$137.39 million, the rate of return for payments in 4th year have the mean=1.1449 and standard
deviation=0.0452. On the right side of Figure 3 is the distribution of payments in 5th year, the mean of
the payments is $213.44 million, the rate of return for payments in 5th year have the mean=1.1858 and
standard deviation=0.0510.

III. Bond Selection


During the bond selection process, we first set up the constraints, assumptions and goals we have for
selecting the bonds portfolio, and then we used MATLAB to solve the optimization problem by finding
the portfolios meet our investment criteria the best.
1. Constraint
There is one constraint we think we should follow during the bond selection process:

Have positive cumulative gap in 2017 and 2018 (2017 cumulative gap is equal to 2017
single-year gap)

The reason for having this constraint is that we need to make sure we have enough asset to cover
our liability in both 2017 and 2018.
2. Assumptions
There are several assumptions we have during the bond selection process:
(1) No short selling of bonds
(2) Invest as much as possible of the 300million into the bonds portfolio.
(3) All the bonds will be held to maturity, ie, we wont sell any five year bond in 2017 to meet
the 2017 liability.
(4) We can use the cumulated coupon payments from 2013 to 2017 to cover our liability in
2017.
(5) If there is a positive gap in 2017, the gap amount will be appreciated under the one year Tbill rate: 0.8%. And the appreciated gap amount will be treated as asset in 2018.
(6) Year-4 liability and Year-5 liability are highly correlated, so when we apply a confidence level
to Year-4 to calculate that years liability, we will use the same confidence level to Year-5 to
calculate 2018s liability.
3. Ways to find the optimal bond portfolios
Based on the investment goal we have, we could have two ways to determine the optimal portfolio:
(1) Minimum Cumulative Gap standard deviation method
Our definition of minimize cumulative gap standard deviation:
Because we wont sell any 5-year bonds in 2017, our assets level are fixed after
we selected the bonds (assuming no default happened; credit risk assessment
regarding defaults will be assessed separately in the later part of our report). In
turn, this means the 2017 cumulative gap distribution is just shifted 2017
liability distribution, and 2018 cumulative gap distribution is just shifted 2018
liability distribution, which means the standard deviations of 2017 cumulative
gap distribution is the same as that of 2017 liability distribution, and the
standard deviation of 2018 cumulative gap distribution is the same as that of
2018 liability distribution.

With above being said, we cant minimize the standard deviation of those gap
distributions because they are determined by those of the liabilities which are
given.
So what we mean by minimizing cumulative gap standard deviation is to
minimize the following measure

Where
x1=2017 cumulative gap amount,
x2=2018 cumulative gap amount,
=
(2) Maximum Cumulative Gap mean method: similar to the definition of minimizing standard
deviation, what we mean by maximizing cumulative gap mean method is to maximize the
following measure:
=
In either way, we need to first calculate the gap amounts in 2017 and 2018.
4. Liability analysis revisit
(1) In order to select our optimal bond portfolios, we first revisit our liabilities distribution in 2017
and 2018 to see how well our simulation mimic the actual distribution:
As it is mentioned at the end of previous section, by looking at our simulation, we see
that the four-year return has a mean of 1.1449 and a standard deviation of 0.0452, the
five-year return has a mean of 1.1858 and a standard deviation of 0.0510. We also
calculated the four-year and five year annual return both equals to 1.348, the four-year
annual return standard deviation is equal to 1%, and five-year annual return standard
deviation is equal to 0.89%.
These number make sense because the annual return=1.0348 1+3.5%, which is the
expected annual return. And the four-year annual standard deviation=0.01=0.02/ ,
which is approximately the expected four-year annual return standard deviation, and
the five-year standard deviation=0.00890.02/ , which is approximately the expected
five-year annual return standard deviation.
The calculations of the cumulative gaps in 2017 and 2018 will be based on an expected
annual return equals to 1.035, a four-year annual return standard deviation equals to
1%, and a five-year annual return standard deviation equals to 0.89%. The 2017 and
2018 liability level at different percentile in the distribution is summarized below (we
chose 95th percentile liability as our target level; will be discussed later in section
5.(2).a.i):

Percentile
50%
60%
70%
80%
90%
95%
99%
99.96%

Percentile
50%
60%
70%
80%
90%
95%
99%
99.96%

Table 3.1 Year 4 Liability


Annual Required Yield Year 4 Liability Amount
0.035
137702760.1
0.037533471
139055992.8
0.040244005
140514820.4
0.043416212
142236667.2
0.047815516
144650702.2
0.051448536
146667310.8
0.058263479
150506924.2
0.068527948
156431708.8
Table 3.2 Year 5 Liability
Annual Required Yield Year 5 Liability Amount
0.035
213783535
0.037254789
216122383.6
0.039667165
218647313.3
0.042490429
221632215.2
0.046405809
225825621.7
0.049639197
229336250.2
0.055704496
236039323.3
0.064839874
246430257.6

5. Portfolio Optimization (selecting the bonds we will invest)


(1) We followed the steps below to prepare for our optimization:
a. Calculated the annual coupon payment and the final payment for each of 24 bonds
available.
b. Set a starting points for the weights allocation among the 24 bonds.
c. Based on the weights allocation, calculate the number of bonds we are going to
invest initially for each of the 24 bonds.
d. Calculated the cumulative asset value we have in 2017, which is equal to the
cumulative coupon payments from 2014 to 2017 for all the 24 bonds(appreciated at
0.8% annually) plus the 4-year bonds par value in 2017. (As we noted before, we
have the assumption that we wont sell any five-year bond to meet the liability
in2017)
e. Decide a confidence level, and then select a liability amount from Table 3.1 and
Table 3.2.
f. Calculate the 2017 gap using 2017 cumulative asset value minus 2017 liability.
g. Calculate the cumulative asset value in 2018, which is equal to the five-year bond
par value plus 2018 coupon payment, and plus the 2017 gap*1.008.(As we noted
before, we have the assumption that any positive gap in 2017 will be appreciated at
the one year T-bill rate)

h. Calculate the 2018 cumulative gap using 2018 cumulative asset value minus 2018
liability.
i. Calculate the mean and standard deviation of the two cumulative gaps.
(2) We then use MATLAB function fmincon to solve the optimization problem. (For each
optimization process, we used 100 starting points of weights, as we noted that with
different starting points, the results will be different, see Appendix II for the MATLAB codes
used in this optimization process). As we mentioned before, we could have two ways to
optimize the portfolio, one is to minimize the standard deviation of cumulative gap, and the
other one is to maximize the mean of the cumulative gap.
a. First Way: Minimize standard deviation of cumulative gap
i. Use fmincon to solve for bonds portfolios that minimize the standard
deviation of cumulative gap. Since we have 100 starting points, this gives us
100 portfolios. (After several trails, we found out that there is no feasible
solution for the 99.96% and 99% liability level under our constraints and
assumptions, so our optimal portfolio here is based on the 95th percentile
liability amount in both 2017 and 2018)
ii. Because in many cases the weights in the optimized portfolios are very
small, we then change all the weights less than 0.01% to 0. Doing this also
makes it possible to select only 2-4 bonds for our portfolios.
iii. Pick the portfolios that have less than 4 bonds. By doing this we eliminates
the number of portfolios to 40.
iv. Because the results are different for different starting points (cumulative
gaps and their standard deviation are different for different initial weight
allocation), and because we like small standard deviations and large
cumulative gap(extra buffer for the liability), so we first divided the 40
portfolios 2018 cumulative gaps by their standard deviation, and then sort
the ratio from the smallest to the largest among:
Ratio of Cumulative Gap to Standard Deviation
=
v. We picked highest ranked portfolios as our optimal portfolio. The best
portfolios we picked here are shown in graphs s and table below:

Graph 1 Ratio of Cumulative Gap to Standard Deviation


Table 3.3 Best Portfolio that Minimize Cumulative Gap Standard Deviation-Portfolio 1
6000
HSBC FIN CORP HSBC FIN
MORGAN STANLEY D W DISC SRMTNS CASE NEW HOLLANDINC PEABODY ENERGY CORP
Weight
0.000632419
0.263605417
0.000184305
0.735570496
5000Gap Best Portfolio
2017 Cumulative
1286638.79
2018 Cumulative Gap
1285601.08
4000 Gap
Mean of Cumulative
1286119.93
Standard Deviation of
Cumulative3000
Gap 6.00E+06
509.12

Standard Deviation

Graph 2 Portfolio's Standard Deviation and Cumulative Gap

20005.00E+06
4.00E+06
1000
3.00E+06
02.00E+06
0.00E+00
1.00E+06

1.00E+06

0.00E+00
0

2000000

2.00E+06
Best Portfolio
4000000

3.00E+06

4.00E+06

6000000

2018 Cumulative Gap

8000000

5.00E+06
10000000

6.00E+06
12000000

b. Second Way: Maximize mean of cumulative gap.


i. Use fmincon to solve for bonds portfolios that maximize the mean
of cumulative gap. Again we used 100 starting points of weight
allocation, and got 100 results. And again no feasible solution for
the 99.96% and 99% liability level under our constraints and
assumptions, so our optimal portfolio here is based on the 95th
percentile liability amount in both 2017 and 2018.
ii. Because in many cases the weights in the optimized portfolios are
very small, we then change all the weights less than 0.01% to 0. By
doing this we got consistent results for all the 100 starting points of
weight allocation. The optimal portfolio contains two assets. The
best portfolios we picked here is shown below:
Table 3.4 Best Portfolio that Maximize Cumulative Gap mean-Portfolio 2
MORGAN STANLEY D W DISC SRMTNS
PEABODY ENERGY CORP
Weight
0.3308
0.6692
2017 Cumulative Gap
20523617.37
2018 Cumulative Gap
85.48
Mean of Cumulative Gap
132175754.63
Standard Deviation of
Cumulative Gap
10261765.95
6. Putting Assets, Liabilities and Gap together

Now we have two portfolios as our candidates for further review. The liability, asset and gap
amounts under the two portfolios are shown in the below figures:

(1) Portfolio 1 (Minimized Standard Deviation of Cumulative Gap)


a. Assets and Liabilities

b.

Gap distributions

(2) Portfolio 2 (Maximized Mean of Cumulative Gap)


a. Assets and Liabilities

b.

Gap distributions

IV. Market and Credit Risk Assessment


1. Market Risk Assessment
Here we used first order derivative to measure market risk. Our goal is to analyze how the
cumulative gap in 2017 and 2018 will change when interest rate change by 100 basis point.
(Because no 2018 bonds will be sold in 2017, interest rate changes will only have impacts on our
liabilities)

Assumption:
o

Here we assumed the bond index return and interest rate will have a perfect
correlation-when interest rate increase 100 basis point, the bond index return
will also increase by 100 basis point.

Because the coupon payment will have very limited effects on the asset level,
here we are not taking into account that the one-year T-bill rate will change as

interest rate changes, in another words, the coupon payments will be


appreciated at the previous rate, 0.8%.

(1) Finding the first order derivative for 2017 and 2018 liability, which are denoted as 17LIB and
18LIB separately in the later part of the calculation. (In the below calculation, r17 is the 95th
percentile 4-year bond index annual yield, and r18 is the 95th percentile 5-year bond index
annual yield, see table 3.1 and table 3.2 for detail)
a. 2017 Liability Interest Rate Sensitivity

b. 2018 Liability Interest Rate Sensitivity

(2) See how the cumulative gaps will be impacted by interest rate change for both portfolio1
and portfolio2.
a. Portfolio 1-Four bonds portfolio
i.
2017 cumulative gap interest rate sensitivity(because our asset level is not
sensitive to interest rate change, the first order derivative is the same as that of
liability)

ii.

2018 cumulative gap interest rate sensitivity

b. Portfolio 2-two bonds portfolio


i.
2017 cumulative gap interest rate sensitivity

ii.

2018 cumulative gap interest rate sensitivity

In summary, portfolio ones 2017 and 2018 cumulative gaps are both very sensitive to interest rate
changes, portfolio twos 2017 cumulative gap is relatively not very sensitive to interest rate change, but
2018 cumulative gap is extremely sensitive to interest rate changes. It looks like portfolio1 will be
preferred to portfolio2 because interest rate changes could have extremely severe adverse impact on
portfolio2s 2018 cumulative gap.
2. Credit Risk Assessment
In this part, we apply the credit migration methodology of CreditMetrics to assess future value of our
two portfolios, one is the 2-bond-portfolio, and the other is the 4-bond-portfolio.

We use Credit Var to assess credit risk.


equation to
probability worst case.

. We convert this
(1%). The worst case we find in this report is 1%

(1). Two-Bond-Portfolio
In 2-bond selection, we choose bond Morgan Stanley D W DISC SRMTNS and bond PEABODY ENERGY
CORP in our portfolio. Table 4.1 describes the weights of these two bonds.
Table 4.1 Two-Bond-Portfolio
Morgan Stanley D W DISC SRMTNS
Weight
0.3308
Price
106.25
Coupon
6.875%
Maturity
1-Dec-17
Rating
A
YTM
5.167%

PEABODY ENERGY CORP


0.6692
102.00
6%
15-Nov-17
BB
5.538%

To calculate the credit Var, we follow the steps as below.( The detailed procedures are in appendix.)

First, calculate the forward rates. For nth year Credit Var, we calculate the forward rates f(n,2),
f(n,3),f(n,4),f(n,5).
Second, joint cash flow two bonds each year. We use the forward rates as discount rates to get
the discounted cash flows for each bond. Then we combine two bonds by their weights to get
the joint cash flow.
Third, joint probability distribution. We use the probability of rating A and BB in n-year
migration matrix to reach the joint probability of two bonds.
Fourth, Credit Var. Search the worst 1% probability event. Subtracted worst 1% case from EV,
and then we get the Credit Var.

The credit Var for each year is as below.


Table 4.2 Two-Bond-Portfolio Credit Var
EV
Worst 1% case
st
1 year
98.7572
70.8869
2nd year
98.9612
69.9104
rd
3 year
95.9690
69.2245
4th year
63.4134
36.0030

Credit VaR
27.8702
29.0509
26.7445
27.4104

Before the 4th year, the worst 1% case ranges from 69.2245 to 70.8869. The range is not vast. Credit Var
for each year ranges from 26.7445 to 29.0509. The minimum credit Var occurs in 3rd year, when bond
Morgan Stanley D W DISC SRMTNS matures and bond PEABODY ENERGY CORP leave with one last
payment.

Figure 4.1 Two-Bond-Portfolio Credit Var


100.0000
90.0000
80.0000
70.0000
60.0000
50.0000

Credit VaR

40.0000

Worst 1% Case

30.0000
20.0000
10.0000
0.0000
1st year

2nd year

3rd year

4th year

(2). Four-Bond-Portfolio
In 4-bond selection, we choose bond Morgan Stanley D W DISC SRMTNS, bond PEABODY ENERGY CORP,
bond HSBC FIN CORP HSBC FIN, and bond CASE NEW HOLLAND INC in our portfolio. Table 4.3 describes
the weights of these four bonds.
Table 4.3 Four-bond-Portfolio
MORGAN STANLEY
Weight
0.2636
Price
106.25
Coupon
6.875%
Mturity
1-Dec-17
Rating
A
YTM
5.167%

PEABODY ENERGY CORP


0.7356
102.00
6.00%
15-Nov-18
BB
5.538%

HSBC FIN CORP


0.0006
117.00
5.75%
15-Nov-17
A
1.39%

CASE NEW HOLLAND INC


0.0002
121.25
7.875%
1-Dec-17
BB
2.36%

To calculate the credit Var, we follow the steps as below. ( The detailed procedures are in appendix.)

First, calculate the forward rates. For nth year Credit Var, we calculate the forward rates f(n,2),
f(n,3),f(n,4),f(n,5).
Second, joint cash flow four bonds each year. We use the forward rates as discount rates to get
the discounted cash flows for each bond. Then we combine four bonds by their weights to get
the joint cash flow.
Third, joint probability distribution. We use the probability of rating A and BB in n-year
migration matrix to reach the joint probability of four bonds.
Fourth, Credit Var. Search the worst 1% probability event. Subtracted worst 1% case from EV,
and then we get the Credit Var.

The credit Var for each year is as below.


Table 4.4 Four-Bond-Portfolio Credit Var
EV
Worst 1% Case
Credit VaR
st
1 year 98.0995
67.4549
30.6446
2nd year 96.2953
66.6730
29.6223
3rd year 95.5214
66.1823
29.3392
th
4 year 69.7026
39.5737
30.1290
Before the 4th year, the worst 1% case ranges from 66.1823 to 67.4539. The range is not vast. Credit Var
for each year ranges from 29.3392 t30.6336. The minimum credit Var occurs in 3rd year, when bonds
Morgan Stanley D W DISC SRMTNS, HSBC FIN CORP and CASE NEW HOLLAND INC mature, and bond
PEABODY ENERGY CORP leave with one last payment.

Figure 4.2 Four-Bond-Portfolio Credit Var


100.0000
90.0000
80.0000
70.0000
60.0000
50.0000

Credit VaR

40.0000

Worst 1% Case

30.0000
20.0000
10.0000
0.0000
1st year

2nd year

3rd year

4th year

The standard deviation of credit Var in 4-bond-portfolio is much lower than standard deviation of credit
Var in 2-bond-portfolio. The difference between the two-bond-portfolio and four-bond-portfolio is that
two-bond-portfolio maximizes the mean of cumulative gap and four-bond-portfolio minimizes standard
deviation of cumulative gap. In the two-bond-portfolio, it provides the maximum payoff for our
corporation, which suits situations such as sufficient funding. In the four-bond-portfolio, it helps the
steady payments to obligors and makes our corporation get fund easily from investors.

V. Final Portfolio Selection


From market risk assessment we see that portfolio1(four-bond-portfolio which minimize the standard
deviation of gaps) is preferable to portfolio2(two-bond-portfolio which maximize the mean of gaps), and
from credit risk assessment we see that four-bond-portfolio Credit VaR is more stable than the twobond-portfolio Credit VaR. So based on above analysis, our final selection of bonds portfolio is portfolio
one (liability is 95th percentile in the distribution):

Weight
2017 Cumulative Gap
2018 Cumulative Gap
Mean of Cumulative Gap
Standard Deviation of
Cumulative Gap

Table 4.5 Best Portfolio-Final Selection


HSBC FIN CORP HSBC FIN
MORGAN STANLEY D W DISC SRMTNS CASE NEW HOLLANDINC PEABODY ENERGY CORP
0.000632419
0.263605417
0.000184305
0.735570496
1286638.79
1285601.08
1286119.93
509.12

Appendix I- Simulate liability in five years


close all;
clc;
cd 'C:\Users\LYL\Documents\Risk Management\projects';
addpath 'C:\Users\LYL\Documents\Risk Management\projects';
% 1. Set initial value
Nstep=5;
pai0=3*1e8;
% 1000 simulated paths
NRep=1e3;
pai=zeros(NRep,Nstep);
pai(:,1)=pai0;
% each year the return follows a normal distribution
for i=1:Nstep;
r=normrnd(0.035,0.02,1e3,1);
pai(:,i+1) = pai(:,i).*(1+r);
end
% liability in year four is equal to 40% of the total of year 4
pai_4=0.4*pai(:,5);
miu_pai4=mean(pai_4./(.4*pai0));
sigma_pai4=std(pai_4./(.4*pai0));
% liability in year five is equal to 60% of the total
pai_5=0.6*pai(:,6);
miu_pai5=mean(pai_5./(.6*pai0));
sigma_pai5=std(pai_5./(.6*pai0));
paipaths=pai;
pai(:,6)=pai_5;
% the following codes are used to plot the data
figure
for i = 1:NRep
plot(1:size(pai,2),paipaths(i,:),'Color',[0 i/NRep 0])
hold on
end
figure
for i = 1:NRep
plot(1:size(pai,2),pai(i,:),'Color',[0 i/NRep 0])
hold on
end
figure
hist(pai_5,100)
hold on
hist(pai_4,100)

Appendix II- Bonds portfolio selection(optimization)


clear all;
close all;
clc;
cd 'S:\2013 Fall\Risk Management\Project 2'
addpath 'S:\2013 Fall\Risk Management\Project 2'
global Libl
% 1. Input Data from Excel and set initial values
% (1)Select the specific confidence level of liability from the excel, here
it is 95%.(The row contains the data is in row 6, so here set it as 6)
Libl=6;
% (2) Input bond data from Excel
bData=csvread('data.csv');
% (3) Input Liabilities under different confidence level from Excel (In the
Excel we already calculated what will be the liability amount under different
confidence level, here we just input them into MATLAB)
y4Lib=csvread('y4Lib.csv');
y5Lib=csvread('y5Lib.csv');
% (4) We will use 100 random starting values for initial weight allocation
nVal=100;
% 2. Set up Constraints
% (1) No short selling: weights are no less than 0
A1=-eye(24);
b1=zeros(24,1);
% (2) 2017 and 2018 cumulative gap no less than 0(A2t here is 2017 cumulative
gap, A3t here is 2018 cumulative gap)
A2t=-(3e8./(-bData(:,1)).*bData(:,7)-y4Lib(Libl,3));
A2=A2t';
A3t=-(1.008*(3e8./(-bData(:,1)).*bData(:,7)-y4Lib(Libl,3))+(3e8./(bData(:,1)).*bData(:,8)-y5Lib(Libl,3)));
A3=A3t';
b2=0;
b3=0;
A=[A1;A2;A3];
b=[b1;b2;b3];
% (3) The total of weights should equal to 1
Aeq=ones(1,24);
beq=1;
ystdStack=zeros(nVal,1);
sstdevStack=zeros(nVal,1);
wStack=zeros(nVal,24);
options=optimset('MaxIter',1e8,'MaxFunEval',1e8,'TolFun',1e-8);
% 3. Find the optimal portfolio
for i=1:nVal
% (1) Generate 100 random starting value for weights
wi=rand(24,1);
w0=wi./sum(wi);
% here we just show the formula used to minimize standard deviation, the one
used for maximize mean is similar
[w,ystd]=fmincon(@(w)stdMin(w,bData,y4Lib,y5Lib),w0,A,b,Aeq,beq,[],[],[],opti
ons);
wStack(i,:)=w';

ystdStack(i)=ystd;
end
% (2)Codes below are to store cumulative gap amount.
cgap17=zeros(nVal,1);
cgap18=zeros(nVal,1);
Asset17=zeros(nVal,1);
Asset18=zeros(nVal,1);
for i=1:nVal
w=wStack(i,:);
w=w';
reinvyield=0.008;
individualInv=w.*3e8;
numberBond=individualInv./(-bData(:,1));
stAsset17=numberBond.*bData(:,7);
Asset17(i)=sum(stAsset17);
sgap17(i)=Asset17(i)-y4Lib(Libl,3);
cgap17(i)=sgap17(i);
stAsset18=numberBond.*bData(:,8);
Asset18(i)=sgap17(i)*(1+reinvyield)+sum(stAsset18);
sgap18(i)=Asset18(i)-y5Lib(Libl,3);
cgap18(i)=cgap17(i)+sgap18(i);
end

% Function of calculating cumulative gap standard deviation


function [sstdev]=stdMin(w,bData,y4Lib,y5Lib)
global Libl
reinvyield=0.008;
individualInv=w.*3e8;
numberBond=individualInv./(-bData(:,1));
stAsset17=numberBond.*bData(:,7);
sgap17=sum(stAsset17)-y4Lib(Libl,3);
cgap17=sgap17;
stAsset18=numberBond.*bData(:,8);
cgap18=sgap17*(1+reinvyield)+sum(stAsset18)-y5Lib(Libl,3);
sstdev=std([cgap17,cgap18],1);
end

% Function of calculating mean of cumulative gap


function [sstmean]=meanMax(w,bData,y4Lib,y5Lib)
global Libl
reinvyield=0.008;
individualInv=w.*3e8;
numberBond=individualInv./(-bData(:,1));
stAsset17=numberBond.*bData(:,7);
sgap17=sum(stAsset17)-y4Lib(Libl,3);
cgap17=sgap17;
stAsset18=numberBond.*bData(:,8);
cgap18=sgap17*(1+reinvyield)+sum(stAsset18)-y5Lib(Libl,3);
sstmean=-mean([cgap17,cgap18]);
end

Appendix III-Data used for Credit VaR Analysis


1. Two-Bond-Portfolio
(1)1st year Credit Var
Joint Cash Flow
MS,PEA

AAA

AA

BBB

BB

AAA

104.23195

104.11113

103.75687

103.01269

99.315654

96.692074

87.01536

AA

104.18484

104.06402

103.70976

102.96558

99.2685459

96.644966

86.968252

71.071141
71.024033

104.04773

103.92692

103.57266

102.82847

99.1314399

96.50786

86.831146

70.886927

BBB

103.7475

103.62669

103.27243

102.52825

98.8312107

96.207631

86.530917

70.586697

BB

102.38009

102.25927

101.90501

101.16083

97.4637963

94.840216

85.163503

69.219283

101.33592

101.2151

100.86084

100.11666

96.4196249

93.796045

84.119331

68.175112

96.703859

96.583044

96.228784

95.484601

91.7875665

89.163986

79.487273

63.543053

86.960806

86.839991

86.48573

85.741548

82.0445132

79.420933

69.744219

53.8

Joint pdf
MS,PEA

AAA

AA

BBB

BB

AAA

0.000027%

0.000126%

0.000603%

0.006957%

0.072477%

0.007956%

0.000900%

AA

0.000681%

0.003178%

0.015209%

0.175471%

1.828031%

0.200668%

0.022700%

0.024062%

0.027315%

0.127470%

0.610035%

7.038165%

73.322565%

8.048820%

0.910500%

0.965130%

BBB

0.001656%

0.007728%

0.036984%

0.426696%

4.445256%

0.487968%

0.055200%

0.058512%

BB

0.000222%

0.001036%

0.004958%

0.057202%

0.595922%

0.065416%

0.007400%

0.007844%

0.000078%

0.000364%

0.001742%

0.020098%

0.209378%

0.022984%

0.002600%

0.002756%

0.000003%

0.000014%

0.000067%

0.000773%

0.008053%

0.000884%

0.000100%

0.000106%

0.000018%

0.000084%

0.000402%

0.004638%

0.048318%

0.005304%

0.000600%

0.000636%

EV

98.75717

Worst

70.88693

Credit VaR

27.87025

0.000954%

(2)2nd year Credit Var


Joint Cash Flow
MS,PEA

AAA

AA

BBB

BB

AAA

101.694847

112.320136

112.29855

112.261164

97.8543932

95.3933239

111.322692

70.0593453

AA

101.663553

112.288843

112.26726

112.22987

97.8230998

95.3620305

111.291399

70.0280519

101.545862

112.171152

112.14957

112.112179

97.7054083

95.244339

111.173707

69.9103603

BBB

101.365882

111.991172

111.96959

111.932199

97.5254287

95.0643594

110.993727

69.7303807

BB

100.424041

111.04933

111.02775

110.990357

96.583587

94.1225176

110.051886

68.788539

99.4827785

110.108068

110.08649

110.049095

95.6423248

93.1812555

109.110623

67.8472768

97.049089

107.674379

107.6528

107.615406

93.2086353

90.747566

106.676934

65.4135874

85.4355016

96.0607912

96.039209

96.0018183

81.595048

79.1339786

95.0633466

53.8

Joint pdf
ABC,JAG

AAA

AA

BBB

BB

AAA

0.000103%

0.000529%

0.002974%

0.023579%

0.119153%

0.026597%

0.003298%

AA

0.002354%

0.012148%

0.068253%

0.541106%

2.734352%

0.610351%

0.075688%

0.107340%

0.047295%

0.244065%

1.371302%

10.871653%

54.937317%

12.262891%

1.520694%

2.156631%

BBB

0.005612%

0.028960%

0.162715%

1.290004%

6.518730%

1.455085%

0.180442%

0.255901%

BB

0.000896%

0.004625%

0.025988%

0.206036%

1.041155%

0.232402%

0.028820%

0.040872%

0.000333%

0.001721%

0.009667%

0.076641%

0.387288%

0.086449%

0.010720%

0.015203%

0.000023%

0.000119%

0.000668%

0.005298%

0.026774%

0.005976%

0.000741%

0.001051%

0.000084%

0.000433%

0.002432%

0.019281%

0.097433%

0.021749%

0.002697%

0.003825%

EV

98.96122

Worst

69.91036

Credit VaR

29.05086

0.004677%

(3)3rd year Credit Var


Joint Cash Flow
MS,PEA

AAA

AA

BBB

BB

AAA

100.22892

100.167752

99.9209715

99.5952583

97.3221099

95.625478

93.48924

AA

100.21316

100.151986

99.9052058

99.5794927

97.3063442

95.6097123

93.473474

69.400436
69.38467

100.13402

100.072847

99.8260668

99.5003537

97.2272052

95.5305733

93.394335

69.305531

BBB

100.05299

99.9918164

99.7450358

99.4193226

97.1461741

95.4495422

93.313304

69.2245

BB

99.471245

99.4100754

99.1632948

98.8375816

96.5644331

94.8678012

92.731563

68.642759

98.948699

98.8875292

98.6407486

98.3150354

96.0418869

94.345255

92.209017

68.120213

98.376479

98.3153089

98.0685282

97.7428151

95.4696666

93.7730347

91.636797

67.547993

84.628486

84.5673161

84.3205355

83.9948223

81.7216739

80.025042

77.888804

53.8

Joint pdf
MS,PEA

AAA

AA

BBB

BB

AAA

0.000221%

0.001243%

0.007522%

0.044982%

0.148319%

0.050004%

0.006653%

0.012018%

AA

0.004647%

0.026179%

0.158449%

0.947492%

3.124178%

1.053273%

0.140135%

0.253153%

0.062591%

0.352593%

2.134104%

12.761491%

42.078650%

14.186229%

1.887435%

3.409639%

BBB

0.010878%

0.061279%

0.370900%

2.217905%

7.313129%

2.465519%

0.328030%

0.592584%

BB

0.002000%

0.011268%

0.068200%

0.407820%

1.344710%

0.453350%

0.060317%

0.108962%

0.000793%

0.004465%

0.027028%

0.161620%

0.532912%

0.179664%

0.023904%

0.043182%

0.000071%

0.000400%

0.002420%

0.014469%

0.047707%

0.016084%

0.002140%

0.003866%

0.000221%

0.001244%

0.007530%

0.045026%

0.148466%

0.050053%

0.006659%

0.012030%

EV

95.96902

Worst

69.2245

Credit VaR

26.74452

(4)4th year Credit Var


Joint Cash Flow
PEA
BB

AAA

AA

66.73193

A
66.70056

BBB
66.60662

BB

66.43225

B
65.22565

C
64.48457

D
63.33294

36.00296

pdf
PEA
BB

AAA
0.001048

AA

A
0.006373

BBB
0.039682

0.189298

BB

B
0.462356

C
0.207188

D
0.029112

0.064943

EV

63.41338

Worst

36.00296

Credit VaR

27.41042

2. Four-Bond-Portfolio
(1) 1st year Credit Var
Discounted Payoff
MS

AAA

AA

BBB

BB

CCC/C

2015

6.6361

6.632899

6.62842

6.604227

6.513501

6.482791

5.97566

2016

6.3356

6.3295

6.317

6.2752

6.1164

6.0026

5.197

2017

93.039

92.905

92.51

91.666

87.782

84.77

72.08

Price =

106.01

105.87

105.5

104.55

100.41

97.256

83.25

PEA

AAA

AA

BBB

BB

CCC/C

2015

5.791506

5.788712

5.78481

5.763689

5.68451

5.657709

5.21512

2016

5.5292

5.5239

5.513

5.4765

5.338

5.2387

4.535

2017

5.2232

5.2157

5.193

5.1462

4.9281

4.759

4.047

2018

86.809

86.644

86.15

85.145

80.056

76.431

63.83

Price =

103.3529

103.1724

102.643

101.5309

96.00639

92.08591

77.6258

HSBC

AAA

AA

BBB

BB

CCC/C

2015

5.550193

5.54752

5.543772

5.52354

5.44765514

5.4219708

4.997827

2016

5.2989

5.294

5.2836

5.248

5.11554895

5.0204

4.3463

2017

92.059

91.93

91.534

90.7

86.8581603

83.8778

71.322

Price =

102.91

102.8

102.36

101.5

97.4213644

94.3202

80.666

CASE

AAA

AA

BBB

BB

CCC/C

2015

7.601351

7.59768

7.592557

7.56484

7.460918996

7.4257426

6.84485

2016

7.2571

7.25

7.2363

7.188

7.00607791

6.87576

5.9526

2017

93.909

93.77

93.373

92.52

88.603537

85.5633

72.755

Price =

108.77

108.6

108.2

107.3

103.070534

99.8648

85.553

EV

98.0995

WORST

67.4549

Credit Var

30.6446

(2) 2nd year Credit Var

53.8

53.8

53.8

53.8

Discounted Payoff
MS

AAA

AA

BBB

BB

CCC/C

2016

6.5637

6.5605

6.5524

6.5325

6.4559

6.3658

5.9788

2017

96.388

96.296

95.949

95.425

92.654

89.899

82.929

Price =

102.95

102.86

102.5

101.96

99.11

96.265

88.908

PEA

AAA

AA

BBB

BB

CCC/C

2016

5.7283

5.7256

5.7185

5.7011

5.6342

5.5556

5.2178

2017

5.4113

5.4061

5.3866

5.3572

5.2016

5.0469

4.6557

2018

89.934

89.806

89.356

88.635

84.499

81.055

73.435

Price =
HSBC

101.0736
AAA

100.9382
AA

100.4613
A

99.69371
BBB

95.33474
BB

91.65711
B

83.30847
CCC/C

2016

5.4896

5.487

5.4802

5.4635

5.3995

5.3241

5.0004

2017

95.373

95.283

94.939

94.42

91.679

88.952

82.056

Price =
CASE

100.86
AAA

100.77
AA

100.42
A

99.884
BBB

97.078
BB

94.277
B

87.056
CCC/C

2016

7.5184

7.5148

7.5055

7.4827

7.3949

7.2917

6.8484

2017

97.29

97.197

96.847

96.318

93.521

90.74

83.705

104.81
96.29531

104.71

104.35

103.8

100.92

98.032

90.553

Price =

53.8

53.8

53.8

53.8

EV
66.67303
WORST
29.62228
Credit Var

(3)3rd year Credit Var


Discounted Payoff
MS

AAA

AA

BBB

BB

CCC/C

2017

100.96

100.91

100.67

100.43

98.669

97.09

95.36

Price =

100.96

100.91

100.67

100.43

98.669

97.09

95.36

PEA

AAA

AA

BBB

BB

CCC/C

2017

5.6679

5.6652

5.6518

5.6381

5.5393

5.4506

5.3535

2018

94.2

94.111

93.756

93.283

89.985

87.538

84.443

Price =
HSBC

99.86767
AAA

99.77626
AA

99.40749
A

98.920775
BBB

95.52396
BB

92.988646
B

89.79642
CCC/C

2017

99.897

99.85

99.613

99.371

97.6307

96.068

94.356

Price =
CASE

99.897
AAA

99.85
AA

99.613
A

99.371
BBB

97.6307
BB

96.068
B

94.356
CCC/C

2017

101.9

101.86

101.61

101.37

99.5925

97.998

96.252

Price =

101.9
95.52144

101.86

101.61

101.37

99.5925

97.998

96.252

EV
66.18227
WORST

53.8

53.8

53.8

53.8

29.33917
Credit Var

(4)4th year Credit Var


Joint Cash Flow
PEA

AAA

BB

AA

73.35033

A
73.31585

BBB
73.21259

BB

73.02093

B
71.69466

C
70.88007

D
69.61423

39.57369

pdf
PEA

AAA

BB

AA

0.001048

A
0.006373

EV

69.70264

Worst

39.57369

Credit VaR

30.12895

BBB
0.039682

0.189298

BB

B
0.462356

C
0.207188

D
0.029112

0.064943

Das könnte Ihnen auch gefallen