/* ** Version 01 ** Date : 20/07/2001 ** -------------------------------------------------------------------------- ** Copyright K.Cuthbertson and D. Nitzsche ** "Financial Engineering:Derivatives and Risk Manangement" - J. Wiley 2001 ** ** VALUE AT RISK: SPOT ASSETS ** ** Calculation of VaR for Spot Assets (Stocks) Table 22.1 and Table 23.1 ** */ new ; cls ; format /m1/rd 12,4; output on ; screen on ; /* output file=c:\docs\arun\out.out reset; @ USER TO CHECK FILEPATH @ */ /* " ------------------------------------------------------------------------------------------ " ; " VaR of Portfolio of Spot Assets (Var-Cov method) " ; " ------------------------------------------------------------------------------------------ " ; ?; " Number of assets (stocks) in the portfolio (n) "; ?; " Initial $-values in each asset:negative implies short sale (V0) "; ?; " Standard Deviation (%) of Returns: Daily, % p.a. (sigma) "; ?; " Correlation matrix between asset returns (R) "; ?; " $ Portfolio Value-at-Risk (VaR) "; */ @ ---------------------- USER INPUT HERE (see Chp 22, T 22.1 ) ----------------------------- @ n =2 ; @ Number of 'spot' assets @ V0 = {10, 5 } ; @ $-millions - n entries required @ sigma = {1.5, 1.0 } ; @ Daily, % p.a. - n entries required @ R = { 1.0 -0.10, @ (n x n) symmetric matrix @ -0.10 1.0 } ; @ ----------------------- END USER INPUT (see Chp 22, T 22.1 ) ----------------------------- @ @ --------------------------------- VaR Calculations ---------------------------------------- @ Z = V0.*1.65.*(sigma/100) ; VaR = sqrt( Z'*R* Z ) ; " ----------------------------------------------------------------------------------------------------------- " ; " Print Output: Table 22.1 VaR of Portfolio of 2 Spot Assets (Var-Cov method) " ; " ----------------------------------------------------------------------------------------------------------- " ; ?; " Number of Cash Flows/ Assets in the portfolio (n) " n ; ?; " Initial $-values in each asset (V0): negative implies short sale " V0 ; ?; " Daily Standard Deviation of Returns ( % Daily) " sigma ; ?; " Correlation matrix bewteen asset returns (R) " R ; " --------------------------------------------------------------------------------------------------------- " ; ?; " Individual VaRs(Z) Absolute value (Z) " Z~Abs(Z) ; ?; " Diversified VaR=sqrt( Z'*R* Z ) " VaR ; ?; " Worse Case VaR (positive holdings all assets and rho=1 ) " sumc(abs(Z)) ; " ----------------------------------------------------------------------------------------------------------- " ; @ --------------------------------- END OF CODE FOR TABLE 22.1 --------------------------------- @ @ ------------------------ USER INPUT HERE (for Chp 23, T 23.1 ) ------------------------------ @ n =3; V0 = {10000, -10000, 10000 } ; @ Note: asset-2 is held short @ sigma = {5.4180, 3.0424, 3.6363 } ; R = { 1.0 0.962 0.403, 0.962 1.0 0.61 , 0.403 0.61 1.0 } ; @ -------------------------- END USER INPUT (see Chp 23, T 23.1 ) ----------------------------- @ @ ----------------------------------- VaR Calculations ----------------------------------------- @ Z = V0.*1.65.*(sigma/100) ; VaR = sqrt( Z'*R* Z ) ; " --------------------------------------------------------------------------------------------------------- " ; " Print Output: Table 23.1 VaR of Portfolio of 3 Spot Assets (Var-Cov method) " ; " --------------------------------------------------------------------------------------------------------- " ; ?; " Number of Cash Flows/ Assets in the portfolio (n) " n ; ?; " Initial $-values in each asset (V0): negative implies short sale " V0 ; ?; " Daily Standard Deviation of Returns ( % Daily) " sigma ; ?; " Correlation matrix bewteen asset returns (R) " R ; " ------------------------------------------------------------------------------------------------------- " ; ?; " Individual VaRs(Z) Absolute value (Z) " Z~Abs(Z) ; ?; " Diversified VaR=sqrt( Z'*R* Z ) " VaR ; ?; " Worse Case VaR (positive holdings all assets and rho=1 ) " sumc(abs(Z)) ; " ---------------------------------------------------------------------------------------------------------- " ; end;