/* ** Version 01 ** Date : 20/07/2001 ** -------------------------------------------------------------------------- ** Copyright K.Cuthbertson and D. Nitzsche ** "Financial Engineering:Derivatives and Risk Manangement" - J. Wiley 2001 ** ** VALUE AT RISK: FORWARD RATE AGREEMENT (FRA) ** ** VaR for FRA in Table 23.7 ** */ new ; cls ; outwidth 250 ; format /m1/rd 12,4; output on ; screen on ; /* ** output file=c:\docs\arun\out.out reset; @ ----- USER TO CHECK FILEPATH ----- @ */ /* ?; " --------------------------------------------------------------------------------------------" ; Mapping 6m x 12m FRA " --------------------------------------------------------------------------------------------" ; ?; " VaR of 6 x 12m FRA (lend at 6m and receive at 12m) "; ?; " Cash outflow for selling 6m x12m FRA is equivalent to borrowing at t=0 "; " at the 6m-rate and lending at t=0 at the 12m rate "; ?; " Days in 1st and 2nd leg of FRA (days01~days12) "; ?; " Interest Rate (simple,propn) for 1st and 2nd leg of FRA (r1 and r2) "; ?; " Standard Deviation of Asset 'Return' at 1st and 2nd leg (sigma1,sigma2) "; ?; " R = Correlation between 'return' on Asset-1 and Asset-2 "; ?; ?; " $-Notional principal in the FRA (Q) "; ?; " Present Value of synthetic spot cash flows (pv1~pv2) "; ?; " VaR = Value-at-Risk "; ?; " --------------------------------------------------------------------------------------------" ; */ @ ------------------------------------------- USER INPUT HERE ------------------------------------ @ days01 = 182; days12 = 183 ; Q = -1000000; @ notional principal, lend at 6m @ r1 = 0.0639; @ spot rate, p.a. - simple, propn @ r2 = 0.0696; @ spot rate, p.a. - simple, propn @ sigma1 = 0.130121 ; @ sigma (Daily, %) @ sigma2 = 0.291600 ; @ sigma (Daily, %) @ R={ 1 0.7, 0.7 1 } ; @ correlation matrix (2x2) @ @ ------------------------------------------END OF USER INPUT ------------------------------------ @ @ ------------------------------------------- PV of 1st leg --------------------------------------- @ t1 = days01./365; pv1 = Q./(1+t1.*r1); @ ------------------------------------------- PV of 2nd leg ---------------------------------------- @ days02 = days01+days12 ; t2 = days02/365; val2 = -Q.*( (1+r2.*t2) ./ (1+r1.*t1) ); @ value of sythetic at t=2 @ pv2 = - pv1; @ ------------------------------------------ VaR Calculations --------------------------------------- @ t12 = t2-t1 ; f12 = (1/t12).*( ( (1+r2*t2)./(1+r1.*t1) ) - 1 ) ; @ forward rate @ Z = zeros(2,1); Z[1,1] = 1.65*(sigma1/100)*pv1; Z[2,1] = 1.65*(sigma2/100)*pv2; VaR = sqrt( Z'*R* Z ); @ ------------------------------------- Print the output ------------------------------------------------------ @ ?; " -----------------------------------------------------------------------------------------------------------" ; " Mapping 6m x 12m FRA " ; " -----------------------------------------------------------------------------------------------------------" ; ?; " VaR of 6 x 12m FRA (lend at 6m and receive at 12m) " ; " Cash outflow for selling 6m x12m FRA is equivalent to borrowing at t=0 " ; " at the 6m-rate and lending at t=0 at the 12m rate " ; " ------------------------------------------------------------------------------------------------------------" ; ?; " Days in 1st and 2nd leg of FRA (days01~days12) " days01~days12 ; ?; " Interest Rate (simple,propn) for 1st and 2nd leg of FRA (r1 and r2) " r1~r2 ; ?; " Standard Deviation of Asset 'Return' at 1st and 2nd leg (%, per day) " sigma1~sigma2 ; ?; " R = Correlation between return on Leg-1 and Leg-2 " R ; ?; ?; " $-Notional Principal (Q) " Q ; ?; " Cash flows at t1 and t2 in the actual (and synthetic) FRA (Q~val2) " Q~val2 ; ?; " Forward rate over 6 months (1+ f12.*t12): should equal val2./Q " (1+f12.*t12) ; ?; " Present Value of leg-1 and leg-2 of synthetic " pv1~pv2 ; ?; " Individual VaR's of 1st and 2nd legs of FRA " abs(Z') ; ?; " VaR = Value-at-Risk " VaR ; ?; " Worse Case VaR " sumc(abs(Z)); ?; " -------------------------------------------------------------------------------------------------------------" ; end;