financial_risk_management

35

Upload: jonatan-bording

Post on 18-Aug-2015

3 views

Category:

Documents


0 download

TRANSCRIPT

42106 Financial Risk Management

Final AssignmentbyJonatan Bording (s091100)

at

Technical University of Denmark

Spring 2014

DTU Management Engineering, Building 4262800 Kgs. Lyngby, Denmark

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Contents1

Introduction

3

2

Methods

3

2.12.22.32.42.52.63

Foreign currency risk . . . . . . . . . . . . . . . . . . . .Portfolio mapping . . . . . . . . . . . . . . . . . . . . . .Delta-normal VaR for a portfolio of equities and optionsDelta-normal VaR of a currency forward contract . . . .Bond duration portfolio mapping . . . . . . . . . . . . .Bond portfolio VaR . . . . . . . . . . . . . . . . . . . . .

......

......

......

......

......

......

......

......

..........

..........

..........

..........

..........

..........

..........

..........

..........

..........

..........

..........

DTU

99101011111212131414

Computing risk due to EUR exposureComputing equity and options risk .Computing forward contracts risk . .Computing Bond risk . . . . . . . . .Total VaR . . . . . . . . . . . . . . .

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

Risk reduction

5.15.25.35.45.55.6

3446789

Implementation and Results

4.14.24.34.44.55

......

Description of the data

3.1 Portfolio . . . . . . . . . . . . . . . . . . . . . . . . .3.1.1 Mutual funds, stocks and options in portfolio3.1.2 Forward contract in portfolio . . . . . . . . .3.1.3 Bonds in portfolio . . . . . . . . . . . . . . . .3.2 Risk factors . . . . . . . . . . . . . . . . . . . . . . .3.2.1 EURUSD Exchange rates . . . . . . . . . . .3.2.2 GBPUSD Exchange rates . . . . . . . . . . .3.2.3 Interest rates . . . . . . . . . . . . . . . . . .3.2.4 Equity market risk factors . . . . . . . . . . .3.2.5 Bond risk factors . . . . . . . . . . . . . . . .4

......

141518202223

Fixing the price of EUR . . . . . . . .Optimal hedge ratio . . . . . . . . . .Minimum variance optimization . . . .Delta hedging . . . . . . . . . . . . . .Hedging forward contract using optionsDuration hedging . . . . . . . . . . . .

......

......

Jonatan Bording

......

......

......

......

......

......

......

......

......

......

......

......

......

......

......

......

......

......

2323242425261

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

A Computing risk due to EUR exposure

27

B

Computing equity and options risk

27

C

Computing forward contract risk

30

D Computing bonds risk

DTU

33

Jonatan Bording

2

42106 Financial Risk ManagementStudent no.: 091100

1

Final Assignment

Introduction

A portfolio consisting of multiple assets is exposed to the risk of a loss which might resultfrom typical movements in nancial markets. The value-at-risk (VaR) is a measure of thepossible downside from an investment or portfolio. It is an estimate, with a given degreeof condence, of how much one can lose from one's portfolio over a given time horizon.The purpose of this paper is to construct of portfolio consisting of dierent types of assetsand estimate the VaR of the portfolio using the delta-normal method. The delta-normalmethod estimates the VaR assuming that the distribution of the changes in the value ofthe assets follow a normal distribution.The majority of the theory presented and used methods were inspired by Philippe Jorion's"Financial Risk Manager Handbook" 6th edition and Dan Stefanica's "A Primer for theMathematics of Financial Engineering" Second Edition. Calculations were accomplishedusing MathWorks MATLAB 2014a with Statistical Toolbox and Financial Toolbox. Codeis provided in the appendix.

22.1

MethodsForeign currency risk

Consider the exposure of some amount W to equities on a foreign currency. If we ignorethe risk associated with changes in prices of the equities, what remains is the volatily ofthe foreign exchange rate as a risk factor. This is the same as a long position of W shortdomestic currency long foreign currency. If we obtain historical data for the exchangerate we can estimate the value-at-risk for this position. Let RF X be the relative changetin the exchange rate RF X,t = S. Obtaining the emperical distribution of RF X we canStcompute the valule-at-risk at a condence level on a j-step time horizon asV aR (j) = q W

p(j)

(1)

where q is the emperical quantile.

DTU

Jonatan Bording

3

42106 Financial Risk ManagementStudent no.: 091100

2.2

Final Assignment

Portfolio mapping

Given a portfolio consisting of N linear positions in various equities with weights w wehave that the portfolio return Rp isRp =

NX

h

wi Ri = w1 w2

i=1

R1

i R2 . . . wN . = wT R .. RN

t. If we express the return of an individual equity i as a linear combinationwhere Ri,t = PPtof a constant i,0 , components due to market changes (i,k for k = 1, .., K ) and an errorterm i we have

hRi = 1 F1 F2

i,0

i,1iT. . . FK i,2 + i = F i + i .. . i,K

(2)

where Fk is the k-th market factor and i,k is the sensitivity of asset i to market factorFk for k = 1, 2, . . . , K .Written in matrix-form, the portfolio return can then be decomposed intoRp = wT ( T F + ) = wT T F + wT

(3)

where is a K + 1 N matrix.2.3

Delta-normal VaR for a portfolio of equities and options

If the market factors and the residuals error in (3) are independent and we assume thatthe residual errors are uncorrelated, the variance of the equity porfolio isp2 = V [Rp ] = wT T F w + wT 2 w

If the portfolio is well diversied the variance of the residuals should be small and wethereby havep2 wT T F w(4)

DTU

Jonatan Bording

4

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Hence, we if we map the equities in our portfolio to certain market factors we can estimatethe portfolio variance by only concentrating on a few market factors instead of computingthe covariance of all assets in our portfolio.If we assume that the returns and the market factors for our portfolio are jointlynormally distributed, we can compute the portfolio VaR for the equities on a j-step timehorizon aspVaR (j) = z p jVp(5)where Vp is the current value of the equity portfolio and z is a standard normal deviateat a certain condence level .If our portfolio holds options we have to modify (5) slightly. We can approximate thechange in the price of an option as the product of the delta and the change in price of theunderlyingf (S, t) = S

(6)

The delta for a European call option on a asset can be calculated from the BlackScholes formula as = N (d1 )(7)lnd1 =

SK

2+ r q + 2 (T t) T t

where S is the spot price of the underlying at time t; T is the maturity-date of the option;r is the risk-free interest rate (assumed to be constant); q is the continuous dividend rateof the underlying, and is the standard deviation of the returns on the underlying.If we wish to map the change the price of an option to market factors we can given (6)and (2) write the approximationRoption,i (FT i + i )i

(8)

We can then modify (4) by introducing a N 1 vector d with entries di such thatdi =

1

if the i-th asset is an equity

i

if the i-th asset is an option

(9)

and writep2 (w d)T T F (w d)

(10)

where denotes the entrywise product. We then have that the delta-normal VaR for thisDTU

Jonatan Bording

5

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

mixed portfolio isqpVaR (j) = z (w d)T T F (w d) jVp

2.4

(11)

Delta-normal VaR of a currency forward contract

The market value at time t of a forward contract on a foreign currency is given byft = St

11K1 + rt T1 + rt T

(12)

where St is the spot price of foreign currency, rt is an interest rate on the foreign currency,rt is the interest rate on the domestic currency, T is the time to maturity (in years) andK is the delivery price. If we denote the present value of one unit of currency at maturityas P V and P V we can rewrite (12) asft = St P Vt K P Vt

(13)

taking the derivative of (13), we obtaindStdP VdP V (K P V )+ (St P V )StPVPV

(14)

P V P VSt+ (St P V ) (K P V )StPVPV

(15)

dft = (St P V )

We can approximate (14) asft = (St P V )

We see that the change in the price of the forward contract is exposed to three risk factors;St P V V, P V and P. Let the time to maturity T = tM tt+1 . We then have thatStPVP V=PV

1 1+rt (t1m tt )1+rt+1 (tm tt+1 )11+rt (tm tt )

=

1 + rt (tm tt )11 + rt+1 (tm tt+1 )

Thus, if we obtain historical data for the exchange rate and the interest rates we can compute the covariance of the risk factor and thereby estimatethe variance of ft . Let de- ih0note the covariance matrix of the risk factors and let x = (St P V ) (St P V ) (K P V ) .The variance in the change of the price for the forward contract is then2= V [ft ] = x0 xft

DTU

Jonatan Bording

(16)

6

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Assuming that risk factors are jointly normally distributed we can compute the VaRVaR (j) = z ft jp

2.5

Bond duration portfolio mapping

The Macaulay duration of a bond is the weighted average time until repayment, i.e.DM ac

n1 X ti CFi=B i=1 (1 + ykk )kti

(17)

where B is the bond price, i is index of a cashow, k is annual compounding frequency,CFi is the i-th cashow, ti is the time in years until the i-th cashow is received and ykis the periodically compounded yield to maturity.Let Dmod dened as Dmod = B1 dBbe the modied duration of a bond measuring thedyprice sensitivity of the bond with respect to the yield normalized by the bond price. Arelative change in the price of a bond can be approximated asB Dmod yB

(18)

The modied duration can be calculated asDmod =

Dmac(1 + ykk )

Multiplying (18) by the bond price B we obtainB BDmod y

(19)

If we denote the dollar duration D$ = BDmod as the unnormalized version of the modiedduration, then (19) can be written as(20)

B D$ y

For a portfolio VB consisting of bonds we then haveVB =

NXi=1

Bi

NX

D$,i yi

(21)

i=1

For many bonds it is not possible to obtain historical data. Therefore we need tomap each position in our bond portfolio to some risk factor(s). One approach is durationDTU

Jonatan Bording

7

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

mapping, which maps bonds according to their Dmac to the closest possible maturity ofa zero-coupon bond for which historical data is available. As an example, lets considera standard grid of maturities of 1, 3, 5 and 10 years. Let Dmac and D$ be vectorscontaining the macaulay durations and the dollar durations, respectively, for the bonds inour portfolio and let n be a vector where ni is the number of units of the i-th bond in theportfolio. Let xD$ be a vector where the k-th elements is the sum of the dollar durationsof the bonds in our portfolio for which their macaulay durations where nearest to the k-thstandard maturity. If we have N number of bonds in our porfolio the mappings can bedescribed as f : RN 3 N4 PNn D 1(Dmac,i )[0,2) Pi=1 i $,iNnD1(D)imac,i$,i[2,4)f (Dmac , D$ , n) = PNi=1 = xD $nD1(D)imac,i$,i[4,7.5)i=1PNnD1(D)mac,i [7.5,)i=1 i $,i1 if Di A.where 1(Dmac,i )A =0 if D /A

(22)

i

Using this mapping we can now rewrite (21) as

VB xTD$ r +

(23)

where r is the changes in the zero rates (i.e. the changes in the yields for the standardgrid of maturities).2.6

Bond portfolio VaR

If we take the variance of (23) and we assume that the errors are uncorrelated with thechanges in the zero rates we getV [VB ] xTD$ r xD$ + 2

If the portfolio is well-diversied the error term should be relatively small and we cantherefore instead write2V xTD$ r xD$(24)B

DTU

Jonatan Bording

8

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Assuming that the changes in the zero rates are jointly normally distributed we can nowcompute the j-step value-at-risk for a bond portfolio asVaR (j) = z VB jp

3

Description of the data

3.1

Portfolio

The constructed porfolio consists of; 1 forward contract on British pounds, 5 dierentU.S. mutual funds, 7 dierent U.S. stocks, 3 dierent stocks traded on Xetra (Frankfurt),3 dierent European call stock options on U.S. stocks, and 15 dierent coupon-bearingU.S. treasury bonds.3.1.1

Mutual funds, stocks and options in portfolio

Prices and specications for the mutual funds, stocks, options and bonds were obtainedfrom finance.yahoo.com/ and specications are summarized in table 2.

Investment TypeTicker / Underlying Currency Holding Strike Maturity date DividendMutual fundMUTF:VESIXUSD 1m USDMutual fundMUTF:FANAXUSD 1m USDMutual fundMUTF:TFSIXUSD 1m USDMutual fundMUTF:BGSAXUSD 1m USDMutual fundMUTF:JDESEAXUSD 1m USDStockNASDAQ:MSFTUSD 1m USDStockNASDAQ:EBAYUSD 1m USDStockNYSE:IBMUSD 1m USDStockNYSE:WMTUSD 1m USDStockNYSE:XOMUSD 1m USDStockNYSE:CVXUSD 1m USDStockNYSE:CUSD 1m USDStockFRA:DBKEuros 1m USDStockFRA:BASEuros 1m USDStockFRA:LHAEuros 1m USDEuropean Call OptionNYSE:JPMUSD 1m USD 52.5020-Sep-140.38%European Call Option NASDAQ:INTCUSD 1m USD 24.5018-Oct-140.225%European Call OptionNYSE:UTXUSD 1m USD 120.00 17-Jan-150.59%Table 1: Mutual funds, Stocks and Options in portfolio.Weekly historical data for the equities were obtained from 04-May-2004 to 06-May2014. The time series are plotted in gure 1.DTU

Jonatan Bording

9

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 1: Weekly movements in mutual funds and Stocks in portfolio from 04-May-2004 to 06-May-2014.3.1.2

Forward contract in portfolio

The forward contract in the portfolio assumes that we buy 10, 000, 000 at a price of$16, 725, 000 on 20-Aug-2014 specied as

DeliveryPurchase price K Maturity date tmGBP 10,000,000 USD 16,725,00020-Aug-2014Table 2: Forward Contract.3.1.3

Bonds in portfolio

Bonds in portfolio are summarized in table 3.

DTU

Jonatan Bording

10

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Type Clean Price Coupon Rate Settlement date Maturity dateT-NOTE 102.142.125%5-May-201431-May-2015T-NOTE 104.124.125%5-May-201415-May-2015T-NOTE 102.731.750%5-May-201431-May-2016T-NOTE 105.833.250%5-May-201431-May-2016T-BOND 123.618.750%5-May-201415-May-2017T-NOTE99.140.625%5-May-201431-May-2017T-NOTE 104.822.500%5-May-201430-Jun-2017T-NOTE 107.173.125%5-May-201415-May-2019T-NOTE97.351.125%5-May-201431-May-2019T-BOND 139.458.125%5-May-201415-May-2021T-NOTE 106.293.125%5-May-201415-May-2021T-NOTE96.252.000%5-May-201415-Feb-2023T-NOTE 101.960.625%5-May-201415-Jan-2024T-BOND 141.916.750%5-May-201415-Aug-2026T-BOND 130.255.500%5-May-201415-Aug-2028

Issue date First Coupon date31-May-201030-Nov-201015-May-200515-Nov-200531-May-201130-Nov-201131-May-200930-Nov-200915-May-198715-Nov-198731-May-201230-Nov-201230-Jun-201031-Dec-201015-May-200915-Nov-200931-May-201230-Nov-201215-May-199115-Nov-199115-May-201115-Nov-201115-Feb-201315-Aug-201315-Jan-201415-Jul-201415-Aug-199615-Feb-199715-Aug-199815-Feb-1999

units200100150120100170100100130200190140140130160

Table 3: Specications for bonds in portfolio. Face value for all bonds are $10,000. Prices are given aspercentage of face value. Units refer to the number of units of each bond in portfolio.

3.23.2.1

Risk factorsEURUSD Exchange rates

In our portfolio we have a 3m USD exposure to euros due to investments in 3 Germanstocks. Hence, we need data for the EUR/USD price ($ per 1 ). Historical weeklydata for EUR/USD exchange rate from 15-May-2004 to 05-May-2014 was obtained fromoanda.com. The data is plotted in gure 2

Figure 2: Weekly movements EUR/USD exchange rate ($ per 1 ) from 15-May-2004 to 05-May-2014.

DTU

Jonatan Bording

11

42106 Financial Risk ManagementStudent no.: 091100

3.2.2

Final Assignment

GBPUSD Exchange rates

We have a forward contract on 10m British pound in USD. Therefore we need data for theGBP/USD exchange rate ($ per 1 ). Historical weekly data from for the GPB/USD ratesfrom 9-May-2004 to 5-May-2014 was obtained from oanda.com. The data is plotted ingure 3

Figure 3: Weekly movements in EUR/USD exchange rate ($ per 1 ) from 9-May-2004 to 5-May-2014.3.2.3

Interest rates

Risk factors on the forward contract include USD interest rates and GBP interest rates.Historical data from 7-May-2004 to 3-May-2014 for 3-month LIBOR rates on GBP andUSD was obtained from the Federal Reserve Economic Data (research.stlouisfed.org/fred2).The data is plotted in gure 4.

DTU

Jonatan Bording

12

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 4: Weekly movements in 3-months LIBOR rates on GBP and USD.3.2.4

Equity market risk factors

Based on the industry sectors of the equities in our portfolio, the following market indices was identied as risk factors: Dow Jones Industrial Average Index, NYSE US 100Index, NASDAQ Computer Index, KBW Bank Index, Dow Jones U.S Oil and Gas Index and DAX (Deutscher Aktien Index). Weekly historical data was obtained fromfinance.yahoo.com/ and is plotted in gure 5.

Figure 5: Weekly movements in Stock market indices from 04-May-2004 to 06-May-2014. Abbreviations:NASDAQ Computer Index, IXCO; NYSE 100 Index, NY; Dow Jones Industrial Average Index, DJI; KBWBank Index, BKX; Dow Jones U.S Oil and Gas Index, DJUSEN; Deutscher Aktien Index, DAX.

DTU

Jonatan Bording

13

42106 Financial Risk ManagementStudent no.: 091100

3.2.5

Final Assignment

Bond risk factors

As risk factors for the Bonds in the portfolio, yields for 1 year, 3 year, 5 year and 10 yearzero-coupon US Treasury bonds was choosen. Weekly historical yields from 7-May-2004to 03-May-2014 was obtained from the Federal Reserve Economic Data(research.stlouisfed.org/fred2/). The data is plotted in gure 6.

Figure 6: Weekly movements in yields (as percentages) of US zero-coupon Treasury Bonds with dierentmaturities.

44.1

Implementation and ResultsComputing risk due to EUR exposure

We hold a position of 3m USD worth of stocks in euros. Changes in EUR/USD exchangesrates is computed asRF X,t+1 =

St+11St

The empirical distribution of the changes in EUR/USD is plotted in gure 7.

DTU

Jonatan Bording

14

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 7: Distribution of relative weekly changes ind EUR/USD exchanges rate the past 10 years.We nd that the 5% emperical quantile is q0.05 = 0.017463. Using (1) we getpV aR0.05 (2)EU RU SD = 0.017463 $3, 000, 000 (2) = $74, 090

for the 10 business day (2 weeks) 5% VaR. (see appendix A for matlab code)4.2

Computing equity and options risk

First, we compute the returns on the market indices and on the equities in our portfoliocomputed as Rt+1 = PPt+1 1. The results are plotted in gure 8.t

DTU

Jonatan Bording

15

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 8: Returns on market indices and on stocks and mutual funds in portfolio.Red lines illustratestted normal curve.

We see that that the returns are centered around zero and seem stationary in mostperiods.In gure 9 we also see that the distributions of most of the market indices look normal.

DTU

Jonatan Bording

16

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 9: Distributions of the returns on the market indices.In order to map the portfolio positions to the market indices as in (2), we performmultivariate linear regression between the equity returns and the market indices. Resultsare summarized in table 4Ticker / Underlying

Intercept (0 )

IXCO (1 )

NY (2 )

DJI (3 )

BKX (4 )

DJUSEN (5 )

DAX (6 )

R2

MUTF:VESIX

0.0000

0.0835

0.3482

0.0651

0.0141

0.1971

0.4588

0.8452

MUTF:FANAX

0.0002

0.1702

0.0360

0.4413

0.0738

1.1462

0.1527

0.9425

MUTF:TFSIX

0.0000

0.0651

0.4069

0.1088

0.0653

0.0036

0.2130

0.8033

MUTF:BGSAX

0.0002

0.7223

0.3803

0.0828

0.0580

0.0080

0.0460

0.8980

MUTF:JDESEAX

0.0005

0.1734

0.8022

0.0092

0.0193

0.0123

0.0141

0.9876

NASDAQ:MSFT

0.0002

0.7562

0.6655

0.9337

0.0503

0.0755

0.0223

0.5000

NASDAQ:EBAY

0.0003

0.8446

0.4891

0.1226

0.0597

0.0281

0.0058

0.3760

NYSE:IBM

0.0005

0.3255

1.0920

1.6782

0.0061

0.0056

0.0207

0.6028

NYSE:WMT

0.0013

0.1932

0.7858

0.7900

0.1751

0.2755

0.1545

0.4148

NYSE:XOM

0.0007

0.2238

0.0809

0.6141

0.1222

0.6518

0.1227

0.7911

NYSE:CVX

0.0009

0.2008

0.1010

0.4589

0.0692

0.7798

0.0738

0.8357

NYSE:C

0.0031

0.0301

0.0250

0.1576

1.1983

0.0625

0.0469

0.8364

FRA:DBK

0.0017

0.0499

0.5470

0.7581

0.3701

0.0985

1.2484

0.6324

FRA:BAS

0.0032

0.0416

0.6211

1.2850

0.0380

0.3079

1.1571

0.3468

FRA:LHA

0.0000

0.1130

0.1477

0.0660

0.0770

0.2288

0.8695

0.5129

NYSE:JPM

0.0024

0.0838

0.6959

0.1803

0.8515

0.2588

0.0394

0.7773

0.0008

0.9123

0.6873

0.9878

0.0245

0.0734

0.0708

0.6032

0.0013

0.0552

0.7919

1.6230

0.0608

0.0142

0.0768

0.6955

NASDAQ:INTCNYSE:UTX

Table 4: Results from multivariate linear regression between returns on stocks and mutual funds andreturns on market indices.

From the coecients of determination (R2 ) we see that most of the volatility in theportfolio can be explained by the market indices. Not surprisingly, the fraction of varianceDTU

Jonatan Bording

17

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

unexplained is smallest for the mutual funds. We will assume that the portfolio is welldiversied such that the variance which is not explained by our model will be very small.Going forward we compute the standard deviation of the underlyings of the options inorder to compute the deltas using (7). We obtain the vector described in (9)id = 1 1 . . . 0.8183 0.9957 0.12370

h

We have equal weights in the portfolio of 1m USD in each position, so wi = 181 fori = 1, .., 18 as N = 18. We compute the covariance matrix of the market indices F andsubsequently the portfolio variance using (10)p2 = (w d)T T F (w d) = 0.02592

Assuming that the joint distribution of the market indices are normally distributed, weare now able to estimate the 5% value at risk on a 10 business days horizon using (11)pV aR0.05 (2)stock,f unds,options = 1.6449 0.0259 $18, 000, 000 (2) = $1, 084, 563

(see appendix B for matlab code)4.3

Computing forward contracts risk

In order to compute the value at risk for the forward contract we rst must computethe relative monthly changes in the GBP/USD exchange rate and relative changes in thepresent value of GBP and USD computed asU SDGBPP Vt+1P Vt+11 + rtU SD (tm tt )1 + rtGBP (tm tt )=1,= 1,U SDGBPP VtU SD1 + rt+1(tm tt+1 )P VtGBP1 + rt+1(tm tt+1 )

St+1St+1=1StSt

The risk factors are plotted in gure 10 and gure 11

DTU

Jonatan Bording

18

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 10: time series of the risk factors associated with the forward contract; RS , RP V

U SDt+1

t+1

Figure 11: Distributions of the risk factors associated with the forward contract; RS , Rrt+1

Red lines illustrates tted normal curves.

, RP VPGBP.V +1

U SDt+1

GBP ., Rrt+1

We see that the distributions of the risk factors does not seem to approximate normaldistributions really well. They are however centered around zero and going forward wewill assume that they are normally distributed.The current spot price for 10m GBP is St = $16, 842, 000. The delivery price is K =$16, 725, 000. The time to maturity is 0.29166 year and the current LIBOR rates arertGBP = 0.005252 and rtU SD = 0.002229. Computing the vector x we gethix0 = (St P V ) (St P V ) (K P V )hi= $16, 815, 996 $16, 815, 996 $16, 714, 033

By computing the covariance matrix of the risk factors and using (16) we can calculatethe variance2f= x0 x = $185, 0402t

DTU

Jonatan Bording

19

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Assuming that the risk factors are jointly normally distributed we can calculate the 5%VaR on a 10 business day time horizon for the forward contractV aR0.05 (2)ft = 1.6449 $185, 040

2 = $430, 436

(see appendix C for matlab code)4.4

Computing Bond risk

In order to compute the risk associated with our bond positions we compute the week-toweek dierence in yields of our bond risk factors (zero-coupon bonds). These are plottedin gure 12 and gure 13

Figure 12: Week-to-week dierences in yields for zero-coupon US treasury bonds (r) with dierentmaturities.

DTU

Jonatan Bording

20

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

Figure 13: Distributions of Week-to-week dierences in yields for zero-coupon US treasury bonds (r)with dierent maturities. Red lines illustrates tted normal curves.

We see that the zero rates r are centered around zero and they are highly correlated.The distributions of the risk factors look somewhat normally distributed.Next, we compute the durations Dmac,i and the dollar durations D$,i of the bonds in ourportfolio using (17) and store the number of units for each bond type in the portfolio ina vector n

Dmac

DTU

1.0560.99846 2.0293 1.9958 2.6706 3.0387 3.0317 = 4.6418 4.9174 5.6039 6.3009 8.0451 9.4094 9.1127 10.564

,

108.75$105.85$209.54$213.55$339.73 $300.7 $318.89D$ = $500.22$477.09$794.76$671.79$768.33$959.16$1289.1$1368.8Jonatan Bording

,

200 100 150 120 100 170 100 n = 100 130 200 190 140 140 130 160

21

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

and using the mapping in (22) with standard maturities 1, 3, 5, and 10 years we get

f (Dmac , D$ , n) = xD$

$57961.45$148412.85=$398636.01$628449.85

If we compute the covariance matrix r of the changes in the zero rates we are now ableto estimate the variance of the bond positions using (24)2V xTD$ r xD$ = $1170.92B

Assuming that the risk factors are jointly normally distributed we can now estimate the5% VaR on a 10 day time horizonVaR (j) = 1.64485 1170.9

$10, 000 2 = $272, 371100

(note that we multiply by $10,000because the standard deviation was calculated based on100the bond prices as percentages of face value and the face values of the bonds were $10,000.See appendix D for matlab code)4.5

Total VaR

We have now calculated the 10 business day 5% VaR for the dierent parts of our portfolio.Assuming that changes in the value of the dierent parts of our portfolio is uncorrelated*we can aggregate their VaR together and we should have the value at risk for the wholeportfolioV aR0.05 (2)total = V aR0.05 (2)EU RU SD + V aR0.05 (2)stock,f unds,options + V aR0.05 (2)ft + VaR (2)bonds= $74, 090 $1, 084, 563 $430, 436 $ 272, 371= $1, 861, 460

Comparing this to the total value of our portfolioVportf olio = Vf unds,stocks,options +ft +Vbonds = $18, 000, 000+$101, 963+$24, 007, 264 = $42, 109, 228

we can interprate the VaR as that with a probability of 5% we stand to loose0.0442 or more of the value of our portfolio over a 2 weeks period.DTU

Jonatan Bording

$1,861,460$42,109,228

=

22

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

(*It is of course naive to assume that the volatility of stocks, options and funds are uncorrelated with thevolatility of bonds, interest rates and exchanges rates. Just by looking at the plots in gure 8, 10 and 12we see that the variance increases dramatically around year 2007 to 2009 for all risk factors.)

5

Risk reduction

In the following subsections, describtions on how we could reduce the risk of our portfoliois presented.5.1

Fixing the price of EUR

We have a 3m USD exposure to EUR in our equity portfolio in the form of foreign stocks.We could lock in the current exchange rate by shorting futures contracts on EUR and wewould thereby reduced the risk associated with movements in exchanges rates.5.2

Optimal hedge ratio

In order to reduce the risk related to the equities in our portfolio we could short somefutures contract on some broad market index which correlates well with our equity positions. Let Vequity be the change in value of the equity positions in our portfolio. If weshort some number NF of futures contracts with dollar value F on a broad market indexthen the total change in value of our portfolio will beV = Vequity NF F

The variance of our portfolio is now222V= V+ NF2 F NF Vequity Fequity

(25)

We want to nd the number of contracts to shorts such that we minimize the variance ofthe value of our portfolio, so we take the derivative of (25) with respect to NF and set itequal to zero2V= 2NF F 2Vequity F = 0dNF

DTU

Jonatan Bording

23

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

solving for NF we getNF F = Vequity FNF =

Vequity FVequity= Vequity FFF

We call NF the optimal hedge ratio and Vequity F is then a measure of how much of thevolatility we would be able to hedge using the futures contracts. Letting Requity denotethe return on the equity part of our portfolio and Rindex denote the return on the marketindex which the futures contract is set on. If each futures contracts deliver QF dollarstimes the index such that F = QF index, then we can express the number of futurescontracts we want to short NF asNF = Vequity F

RequityVequity= Requity ,RindexQF RindexQF index

where Requity ,Rindex can be found by performing linear regression of Requity over Rindex .5.3

Minimum variance optimization

Another way to try and reduce the risk of the portfolio could be to nd a linear combination of the weight in our portfolio that would minimize the variance f2unds,stocks . Thatis, we adjust the weights of the positions in the mutual funds and stock such that weminimize the variancemin f2unds,stocks = wT T F w

subject to

NX

wi = 1

i=1

if we allowed for short-selling.5.4

Delta hedging

Let i denote the value of the i-th option in our portfolio and let Si denote the currentstock price of the i-th underlying. Consider the case that we want to reduce the risk ofthe option positions by shorting some number of shares ni of the underlyings on the calloptions and let Ci denote the the current value of the i-th call option. The value of ouroption positions is theni (Si ) = Ci (Si ) ni Si

DTU

Jonatan Bording

24

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

for the i-th option. Assume that the spot price of the underlying changes to by Si + dSiwhere dSi is small relative to the Si . The change in the value of our portfolio is theni (Si + dSi ) i (Si ) = Ci (Si + dSi ) ni (Si + dSi ) (Ci (Si ) ni Si )= Ci (Si + dSi ) C(Si ) ni dSi

(26)

We want to choose the value of ni such that for a small change in the underlying, thevalue of our portfolio does not change. Hence, we want to choose ni such that(27)

i (Si + dSi ) i (Si ) 0

Combining (27) and (26) we getni

Ci (Si + dSi ) C(Si )dSi

and by letting dS 0ni

dCi= idSi

Hence, if we want to reduce the risk associated with the options in our portfolio we shouldshort sell i shares of the i-th underlying of each of the 3 options in our portfolio.5.5

Hedging forward contract using options

In our forward contract we had an spot price St and a delivery price Kf with a time tomaturity Tf . Now consider that we set up a long position in an European put option Ptand a short position in an European call option Pt on 10m GBP on both options with acommon strike Koptions and a time to maturity Toptions . The put-call parity then statesthat the value of the options at time t isPt Ct = Koptions

11+

rtU SD Toptions

St

11+

rtGBP Toptions

The value of the forward contract ft at time t isft = St

DTU

11+

rtGBP Tf

Kf

11+

Jonatan Bording

rtU SD Tf

25

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

We then see that the combined value of the forward contract and the options is zeroft + Pt Ct = Koptions

11+

rtU SD Toptions

St

11+

rtGBP Toptions

+ St

11+

rtGBP Tf

Kf

11+

rtU SD Tf

=0

if Tf = Toptions and Kf = Koptions . Hence, if we long a GBP put and short a GBP callwith the same strike Kf and maturity Tf we have eliminated the risk of our long positionin the forward contract with delivery price Kf and maturity Tf .5.6

Duration hedging

If we want to reduce the risk of our bond portfolio we can hedge the dollar duration ofour bond portfolio. Let VB be the value of our bond porfolio with total dollar durationPD$,VB = Ni=1 D$,i . If we take an additional position of n number of units in an additionalbond Badd with a moded duration Dmod,add , the new value of the bond portfolio is thenVB,new = VB + nBadd

If we want to hedge the risk of our bond portfolio we would want the dollar duration ofour new portfolio to be zeroD$,VB,new = D$,VB + nD$,Badd = 0nD$,Badd = D$,VBn =

D$,VBD$,VB=D$,BaddDmod,add Badd

Hence, we should short n number of units of the additional bond with a total dollarduration equal to the dollar duration of our bond portfolio. It is probably unlikely thatwe would be able to match the dollar durations with only one additional bond but theidea can be expanded to multiple additional bondsn1 Dmod,add,1 Badd,1 n2 Dmod,add,2 Badd,2 ... = D$,VB

such that a linear combination of the dollar durations of dierent additional bonds wouldmatch the dollar duration of our portfolio. Note that, the same principles applies if wechoose to hedge using futures contracts on bonds instead.DTU

Jonatan Bording

26

42106 Financial Risk ManagementStudent no.: 091100

A

Final Assignment

Computing risk due to EUR exposure

1

%% Loading exchange data

2

[, , rates] = xlsread('EUR_USD.xlsx');

3

rates = str2double(rates);

4

%% Load dates and plot data

5

time = import_dates('eur_usd_dates.csv');

6

ts = fints(time,rates,'EURUSD');

7

plot(ts)

89

%% Compute relative weekly changes and plot histogram

10

R_fx = rates(1:end-1)./rates(2:end)-1;

11

[f,x]=hist(R_fx,30);

12

bar(x,f/sum(f))

13

ylabel('Density')

14

xlabel('R EURUSD')

1516

%% find 5% quantile

17

alpha = 0.05;

18

SR_fx=sort(R_fx);

19

N=size(R_fx,1);

20

q=SR_fx(floor(alpha*N));

2122

%% Compute 10 day value at risk

23

W = 3000000;

24

VaR_fx=q*W*sqrt(2)

B

Computing equity and options risk

1

format long g

2

%% Load Indices

3

[, , Indices] = xlsread('equities.xlsx','Factors');

4

Indices_names = Indices(1,2:end);

5

Indices = Indices(2:end,2:end);

6

Indices = str2double(Indices);

78

%% Load Stocks

9

[, , Stocks] = xlsread('equities.xlsx','Stocks');

10

Stocks_names = Stocks(1,2:end);

11

Stocks = Stocks(2:end,2:end);

DTU

Jonatan Bording

27

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

12

Stocks = str2double(Stocks);

13

%% Load Mutual Funds

14

[, , Funds] = xlsread('equities.xlsx','Funds');

15

Fund_names = Funds(1,2:end);

16

Funds = Funds(2:end,2:end);

17

Funds = str2double(Funds);

1819

%% Load options specs

20

[, , Options] = xlsread('equities.xlsx','Options');

21

Options = Options(2:end,2:end);

22

Options_Strike = str2double(Options(:,1));

23

Options_exp = Options(:,2);

24

Options_dividends = str2double(Options(:,3));

2526

%% Bind stocks and funds

27

stocks_funds = [Funds, Stocks];

2829

%% Plot stocks and funds movements

30

names = [Fund_names, Stocks_names]';

31

time = import_dates('DATES.csv');

32

ts = fints(time,stocks_funds,names);

33

plot(ts)

3435

%% Plot Indices

36

ts = fints(time,Indices,Indices_names);

37

plot(ts)

3839

%% Compute weekly returns

40

R_stocks_funds = stocks_funds(1:end-1,:)./stocks_funds(2:end,:)-1;

41

R_Indices = [ones(size(R_stocks_funds,1),1), ...Indices(1:end-1,:)./Indices(2:end,:)-1];

4243

%% Plot Returns on Indices and stocks/funds

44

R = R_Indices(:,2:end);

45

figure

46

subplot(2,1,1);

47

ts_rIndices = fints(time(1:end-1),R,Indices_names);

48

plot(ts_rIndices)

49

ylabel('R_F')

50

subplot(2,1,2);

51

ts_rEquities = fints(time(1:end-1),R_stocks_funds,names);

52

plot(ts_rEquities)

53

ylabel('R_s')

DTU

Jonatan Bording

28

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

5455

%% Plot histograms of returns on Indices

56

figure

57

subplot(2,3,1);

58

histfit(R_Indices(:,2))

59

title(Indices_names(1))

60

subplot(2,3,2);

61

histfit(R_Indices(:,3))

62

title(Indices_names(2))

63

subplot(2,3,3);

64

histfit(R_Indices(:,4))

65

title(Indices_names(3))

66

subplot(2,3,4);

67

histfit(R_Indices(:,5))

68

title(Indices_names(4))

69

subplot(2,3,5);

70

histfit(R_Indices(:,6))

71

title(Indices_names(5))

72

subplot(2,3,6);

73

histfit(R_Indices(:,7))

74

title(Indices_names(6))

75

%% multivariate linear regression

76

n=size(stocks_funds,2);

77

Beta=zeros(size(R_Indices,2),n);

78

R_squares = size(size(Indices,2),1);

7980

for i=1:n

81

[B,BINT,R,RINT,STATS] = regress(R_stocks_funds(:,i),R_Indices);

82

Beta(:,i)=B;

83

R_squares(i) = STATS(1);

84

end

858687

%% Compute volatility of call option underlying stocks

88

sd_underlying = std(R_stocks_funds(:,end-2:end));

8990

%% Compute

9192

rate = 0.0009*ones(3,1);current_date = '05-May-2014';

93

time = days360(current_date, Options_exp)/360; %time to maturity

94

Spot_prices = Stocks(1,end-2:end);

95

Deltas = zeros(3,1);

96

for i=1:3

DTU

of the call options

Jonatan Bording

29

42106 Financial Risk ManagementStudent no.: 091100

Deltas(i) = bls(Spot_prices(i),Options_Strike(i), rate(i), ...

97

time(i), sd_underlying(i), Options_dividends(i));

9899

Final Assignment

end

100101

%% compute vector d

102

d = [ones(size(R_stocks_funds,2)-3,1); Deltas];

103104

%% Computing covariance matrix

105

Sigma_F = cov(R_Indices);

106107

%% compute portfolio volatility

108

% assets are equally weighted

109

w = ones(size(R_stocks_funds,2),1)/size(R_stocks_funds,2);

110

sd_portfolio = sqrt((w.*d)'*Beta'*Sigma_F*Beta*(w.*d));

111112

%% compute 10-day (business days) 5% Value at risk

113

V_p = 1000000*size(R_stocks_funds,2);

114

j = 2; % 10 days business days is 2 weeks

115

z = norminv(0.05);

116

VaR_equities = z*sd_portfolio*V_p*sqrt(2);

117118

%% Risk reduction

119

%% find minimum variance weights of mutual funds and stock positions

120

A=ones(1,15);

121

b=1;

122

Aeq = ones(1,15);

123

beq=1;

124125

fun =@(w) w'*Beta(:,1:15)'*Sigma_F*Beta(:,1:15)*w;x0=w(1:15);

126

x = fmincon(fun,x0,A,b,Aeq,beq);

127128

%% compute new total weighting and new VaR

129

new_w = [x*length(x); ones(3,1)]/18;VaR_pnew = z*sqrt(new_w'*Beta'*Sigma_F*Beta*new_w)*V_p*sqrt(2)

130131132

%% Include 3 new

133

new_w = [new_w; d(end-2:end)]

C

short positions in portfolio

Computing forward contract risk

12

%% Load 3-month libor rates

DTU

Jonatan Bording

30

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

3

%time = import_dates('3month-T-bill_dates_US.csv');

4

[, , raw] = xlsread('liborrates.xlsx','Sheet1');

5

raw(cellfun(@(x) isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};

6

R = cellfun(@(x) isnumeric(x) && islogical(x),raw);

7

raw(R) = {NaN};

8

data = reshape([raw{:}],size(raw));

9

libor_GBP = data(:,1);

10

libor_GBP = libor_GBP(isfinite(libor_GBP(:, 1)), :);

11

libor_USD = data(:,2);

12

libor_USD=libor_USD(isfinite(libor_USD(:, 1)), :);

1314

%% import dates

15

filename = 'D:\Copy\Courses\Financial Risk ...Management\Final\mcode\liborrate-dates.csv';

16

delimiter = '';

17

formatSpec = '%s%[^\n\r]';

18

fileID = fopen(filename,'r');

19

dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, ...'EmptyValue' ,NaN, 'ReturnOnError', false);

20

fclose(fileID);

21

dates

= dataArray{:, 1};

2223

%% Loading exchange data and plot time series

24

[, , rates] = xlsread('GBP_USD.xlsx');

25

rates_gbpusd = cell2mat(rates);

26

time = import_dates('gbp_usd_dates.csv');

27

ts_gbpusd = fints(time,rates_gbpusd,'GBPUSD');

28

plot(ts_gbpusd)

2930

%% construct weekly time series for libor rates

31

names = cellstr(['liborGBP';'liborUSD']);

32

ts_libor = fints(dates,[libor_GBP, libor_USD],names)/100;

33

ts_libor_weekly =toweekly(ts_libor);

34

plot(ts_libor_weekly)

3536

%% compute vector of times to maturity

37

exp_date = '20-Aug-2014';

38

times = days360(time, exp_date)/360; % Time to maturity

3940

%% extract weekly libor rates

41

libor_weekly = fts2mat(ts_libor_weekly);

42

%reverse order

43

libor_weekly = flip(libor_weekly);

DTU

Jonatan Bording

31

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

44

%% build interest risk factors

45

dPV_USD = zeros(length(times)-1,1);

46

dPV_GBP = dPV_USD;

47

for t=1:(length(times)-1)dPV_USD(t) = ...

48

(1+libor_weekly(t,2)*times(t))/(1+libor_weekly(t+1,2)*times(t+1))-1;dPV_GBP(t) = ...

49

(1+libor_weekly(t,1)*times(t))/(1+libor_weekly(t+1,1)*times(t+1))-1;50

end

51

%% compute relative changes in exchange rates

52

ts_R_fx = tick2ret(ts_gbpusd);

53

dR_fx = fts2mat(ts_R_fx);

5455

% merge risk factors in a matrix

56

F = [dR_fx, dPV_GBP, dPV_USD];

57

%% plot as time series

58

names = cellstr(['dS

59

ts_merged = fints(time(1:end-1),F,names);

60

plot(ts_merged)

';'dPVGBP ';'dPVUSD ']);

6162

%% plot histograms of risk factors

63

figure;

64

subplot(1,3,1)

65

histfit(dR_fx)

66

title('dRfx')

67

subplot(1,3,2)

68

histfit(dPV_GBP)

69

title('dPVGBP')

70

subplot(1,3,3)

71

histfit(dPV_USD)

72

title('dPVUSD')

73

%% set spotprice and current present values

74

K = 16725000; %Delivery price

7576

S = rates_gbpusd(1)*10000000;%Current spot priceT = times(1);%current time to maturity

77

r_USD = libor_weekly(1,2);

7879

PV_USD = 1/(1+r_USD*T);r_GBP = libor_weekly(1,1);

80

PV_GBP = 1/(1+r_GBP*T);

8182

%% compute variance

83

x = [S*PV_GBP; S*PV_GBP; -K*PV_USD];Sigma_F = cov(F);

84

DTU

Jonatan Bording

32

42106 Financial Risk ManagementStudent no.: 091100

85

Final Assignment

sd = sqrt(x'*Sigma_F*x);

8687

%% compute 10 business 5% value at risk

88

z=norminv(0.05);

89

VaR_f=z*sd*sqrt(2);

9091

%% Current value of forward contract

92

ft = S*PV_GBP-K*PV_USD;

D

Computing bonds risk

1

%% Load Bonds

2

[, , Bonds] = xlsread('bonds.xlsx','bond-holdings');

3

Bonds = Bonds(2:end,2:end);

4

Face = 10000; % Face value

5

Prices_B = str2double(Bonds(:,1));

6

CouponRates_B = str2double(Bonds(:,2));

7

Settles_B = Bonds(:,3);

8

Maturities_B = Bonds(:,4);

9

IssueDates_B = Bonds(:,5);

10

FirstCouponDates_B = Bonds(:,6);

11

Units_B = cell2mat(Bonds(:,7));

121314

%% import zero rates (1 year, 3 year, 5 year and 10 year)

15

[, , raw] = xlsread('bonds.xlsx','zerorates_hist');

16

T_names = raw(1,2:end);

17

zerorates = cell2mat(raw(2:end,2:end));

1819

%% plot data

20

time = import_dates('treasury_dates.csv');

21

ts = fints(time,zerorates,T_names);

22

plot(ts)

2324

%% calculate week-to-week spread

25

26

ts = fints(time(2:end),_yield,T_names);

27

plot(ts)

28

ylabel('Delta_yield')

29

%% Compute bond duration and price for Bonds in portfolio and for risk ...

_yield = (zerorates(2:end,:)-zerorates(1:end-1,:))/100;

factors30

[ModDuration, YearDuration, PerDuration] = bnddurp(Prices_B, ...

DTU

Jonatan Bording

33

42106 Financial Risk ManagementStudent no.: 091100

Final Assignment

31

CouponRates_B, Settles_B, Maturities_B, 2, 1, 1, ...

32

IssueDates_B, FirstCouponDates_B);

3334

%% compute dirty prices for bonds in portfolio

35

AccruInterests = acrubond(IssueDates_B, Settles_B, FirstCouponDates_B, ...100,...

36

CouponRates_B);

37

Dirty_prices_B = Prices_B + AccruInterests;

3839

%% Compute dollar duration for the bonds in our portfolio

40

D_dollar = ModDuration.*Dirty_prices_B;

4142

%% Duration Mapping

43

x_dur =zeros(4,1);

44

n = Units_B;

4546

for i=1:length(YearDuration)

47

d = YearDuration(i);

48

if d < 2x_dur(1)= x_dur(1)+1*D_dollar(i)*n(i);

49

elseif d < 4

50

x_dur(2) = x_dur(2)+1*D_dollar(i)*n(i);

51

elseif d < 7.5

52

x_dur(3) = x_dur(3)+1*D_dollar(i)*n(i);

53

else

54

x_dur(4) = x_dur(4)+1*D_dollar(i)*n(i);

55

end

5657

end

5859

%% compute covariance matrix of risk factors

60

Sigma_r = cov(_yield);

61

%% Compute standard deviation

62

sd = sqrt(x_dur'*Sigma_r*x_dur);

6364

%% Compute 5% value at risk on a 10-day time horizon

65

alpha=0.05;

66

z=norminv(alpha);

67

VaR_bonds = z*sd*sqrt(2)*100; %The face value of the bonds is 10,000 - ...thats why we multiply by 10,000/100=100

6869

%% Total bond portfolio value

70

Value_B = Dirty_prices_B.*n;

71

V_bonds = sum(Value_B)*100;

DTU

Jonatan Bording

34