Value-At-Risk (Var)
Value-At-Risk (Var)
Value-At-Risk (Var)
Value-at-Risk (VaR)
The authors describe how to implement VaR, the risk measurement
technique widely used in financial risk management.
by Simon Benninga and Zvi Wiener
I
n this article we discuss one of the modern risk- million dollars by year end (i.e., what is the probability
measuring techniques Value-at-Risk (VaR). Mathemat- that the end-of-year value is less than $80 million)?
ica is used to demonstrate the basic methods for cal-
3. With 1% probability what is the maximum loss at the
culation of VaR for a hypothetical portfolio of a stock and
end of the year? This is the VaR at 1%.
a foreign bond.
We start by loading Mathematica ’s statistical package:
VALUE-AT-RISK
Needs["Statistics‘Master‘"]
Value-at-Risk (VaR) measures the worst expected loss un- Needs["Statistics‘MultiDescriptiveStatistics‘"]
der normal market conditions over a specific time inter-
val at a given confidence level. As one of our references We first want to know the distribution of the end-of-
states: “VaR answers the question: how much can I lose year portfolio value:
with x% probability over a pre-set horizon” (J.P. Mor-
Plot[PDF[NormalDistribution[110,30],x],{x,0,200}];
gan, RiskMetrics–Technical Document). Another way of
expressing this is that VaR is the lowest quantile of the
potential losses that can occur within a given portfolio 0.012
during a specified time period. The basic time period T 0.01
and the confidence level (the quantile) q are the two ma-
0.008
jor parameters that should be chosen in a way appropriate
to the overall goal of risk measurement. The time horizon 0.006
can differ from a few hours for an active trading desk 0.004
to a year for a pension fund. When the primary goal is 0.002
to satisfy external regulatory requirements, such as bank
capital requirements, the quantile is typically very small 50 100 150 200
(for example, 1% of worst outcomes). However for an
internal risk management model used by a company to
The probability that the end-of-year portfolio value is
control the risk exposure the typical number is around
less than $80 is about 15.9%.
5% (visit the internet sites in references for more details).
A general introduction to VaR can be found in Linsmeier, CDF[NormalDistribution[110.,30],80]
[Pearson 1996] and [Jorion 1997]. 0.158655
In the jargon of VaR, suppose that a portfolio manager
has a daily VaR equal to $1 million at 1%. This means that With a probability of 1% the end-of-year portfolio value
there is only one chance in 100 that a daily loss bigger will be less than 40.2096; this means that the VaR of the
than $1 million occurs under normal market conditions. distribution is 100 - 40.2096 = 59.7904.
Quantile[NormalDistribution[110.,30],0.01]
A REALLY SIMPLE EXAMPLE
40.2096
Suppose portfolio manager manages a portfolio which
consists of a single asset. The return of the asset is nor- We can formalize this by defining a VaR function which
mally distributed with annual mean return 10% and annual takes as its parameters the mean mu and standard devia-
standard deviation 30%. The value of the portfolio today is tion sigma of the distribution as well as the VaR level x.
$100 million. We want to answer various simple questions
about the end-of-year distribution of portfolio value: ClearAll[VaR];
VaR[mu_,sigma_,x_]:=
1. What is the distribution of the end-of-year portfolio 100-Quantile[NormalDistribution[mu,sigma],x]
value? VaR[110,30,0.01]
in asset 2, and $45 million in asset 3. Then the return until the bond’s maturity determines its price in foreign
distribution of the portfolio is given by: currency).
mean return = x.m = x1 m1 + x2 m2 + x3 m3 Í The time until the bond’s maturity; along with the for-
variance of return = x.S.x T , eign market interest rate, this will determine the bond’s
where x = {x1 , x2 , x3 } = {0.3, 0.25, 0.45} is the vector of foreign currency price.
proportions invested in each of the three assets. Assuming
Í The exchange rate between the foreign and the domes-
that the returns are normally distributed (meaning that
tic currency.
prices are lognormally distributed), we may calculate the
VaR by: We use historic price and return data to do our VaR
calculations. It is convenient to translate all dates to a nu-
Clear[x,S,means,portfolioMean,portfolioSigma];
X=Table[x[i],{i,3}]; merical format. We set January 1, 1997 to be day number
S=Table[sigma[i,j],{i,3},{j,3}]; 0 and then any day is given by a number of days since
means=Table[mu[i],{i,3}]; the initial date (we assume that all days are business days
portfolioMean[X_,means_,initial_]:= for simplicity).
X.means*initial;
portfolioSigma[X_,s_,initial_]:= Needs["Miscellaneous‘Calendar‘"];
Sqrt[X.s.X]*initial; Needs["Statistics‘Master‘"]
Needs["Statistics‘MultiDescriptiveStatistics‘"]
To implement this: Day0 ={1997, 1, 1};
Clear[VaR]; dayN[ day_]:=DaysBetween[ Day0, day];
X={0.3,0.25,0.45};
Thus January 13, 1997 is the day number 12 and so on.
means={0.1,0.12,0.13};
initial=100; dayN[{1997, 1,13}]
VaRlevel=0.01;
12
S={{0.1,0.04,0.03},{0.04,0.2,-0.04},
{0.03,-0.04,0.6}}; Consider February 10, 1997. Suppose that on February
Print["The portfolio mean = ",
portfolioMean[X,1+means,initial] ]
10, 1997, the stock index value is 293., the foreign interest
Print["The portfolio sigma = ", rate is 5.3%, and the exchange rate is 3.4; February 10,
portfolioSigma[X,S,initial]] 1997 is the 40th business day since January 1, 1997. Thus
VaR[X_,s_,initial_,level_]:=
we write the data for this day as a list: {40, 293., 5.3,
initial-Quantile[ 3.4}. Obviously any real market data must contain much
NormalDistribution[ more information, however will use this simple example
portfolioMean[X,means,initial], to illustrate the VaR approach.
portfolioSigma[X,s,initial]],VaRlevel] The whole data set with which we will be working is
Print["The portfolio VaR at the ",
VaRlevel*100, "% level is ",
the following (in a real-world situation, we would obvi-
VaR[X,S,initial,VaRlevel] ] ously use much more data about many more assets):
The portfolio mean = 111.85 dataVAR ={
{1, 282., 5.28, 3.5},{2, 283., 5.26, 3.47},
The portfolio sigma = 38.4838 {3, 285., 5.23, 3.46},{4, 280., 5.24, 3.45},
The portfolio VaR at the 1. % level is 177.677 {5, 282., 5.25, 3.45},{6, 281., 5.24, 3.46},
{7, 282., 5.24, 3.45},{8, 286., 5.25, 3.43},
{9, 285., 5.25, 3.47},{10, 286., 5.26, 3.443},
USING EMPIRICAL DATA TO CALCULATE THE VAR {11, 288., 5.27, 3.42},{12, 289., 5.28, 3.42},
In this section we use market data to do some VaR cal- {13, 290., 5.28, 3.41},{14, 289., 5.28, 3.42},
culations. Our data consists of 40 business days of data {15, 291., 5.29, 3.46},{16, 293., 5.31, 3.41},
for a market index, foreign interest rates and foreign ex- {17, 294., 5.32, 3.40},{18, 290., 5.34, 3.49},
{19, 287., 5.35, 3.47},{20, 288., 5.34, 3.48},
change rates. We use this data to do three kinds of VaR {21, 289., 5.35, 3.46},{22, 281., 5.36, 3.44},
calculations: Historic simulations, variance-covariance cal- {23, 283., 5.23, 3.45},{24, 285., 5.24, 3.42},
culations, and Monte Carlo simulations. {25, 288., 5.25, 3.41},{26, 289., 5.26, 3.41},
{27, 287., 5.26, 3.43},{28, 285., 5.28, 3.42},
Data Description and Preliminary Calculations {29, 290., 5.27, 3.44},{30, 291., 5.27, 3.42},
We consider the VaR of a portfolio manager who has in- {31, 289., 5.27, 3.37},{32, 288., 5.29, 3.39},
vested in only two assets: A domestic stock index and a {33, 290., 5.28, 3.41},{34, 293., 5.31, 3.44},
foreign bond. For simplicity we assume that the value of {35, 292., 5.32, 3.41},{36, 293., 5.28, 3.42},
{37, 293., 5.30, 3.42},{38, 293., 5.31, 3.44},
this portfolio is wholly determined by only several param- {39, 292., 5.32, 3.41},{40, 293., 5.30, 3.4}};
eters:
Suppose that the financial institution holds two shares
Í The current price of the stock index of the stock index portfolio and a short position in a zero-
Í The foreign market interest rate (the bond is assumed coupon foreign bond having face value 100 rubles with
to have a zero coupon, so that only the interest rate maturity May 8, 2000. We represent this portfolio as a list:
portfolio = { {STOCK,{}, 2}, the bond position has a value of -286.37 = -100 * 3.4 *
{FBOND,{dayN[{2000, 5, 8}]}, -1}} e -0.053*1183/365.25.
Note that the empty paramters list in the stock part For a VaR calculation we have to fix two parameters:
means that there are no parameters and we always keep the time horizon and the confidence level (1 - quantile).
the same portfolio of stocks. The list of parameters of the We choose a one day time horizon and an 80This time
bond part consists of one number - day of maturity. In horizon is a typical one for financial institutions, however
general both lists can have many parameters describing a the confidence level 80% is very low, but it will allow us
specific portfolio of stocks or bonds. to use a short data file. For a higher precision much more
Risk Mapping data is necessary.
“Risk mapping” is a nice wording for a pricing function. Historical Simulation
In a general case we might decompose the pricing func-
tion for each type of financial instrument into simple risk The first method we are presenting here is the histori-
factors (perhaps using the option pricing techniques ex- cal simulation. We pretend that the change in the market
plained in our previous articles). However, in our simple conditions from today to tomorrow are the same as the to
example the current value of each instrument is a sim- the changes that took place some time in the past. There
ple one-dimensional function of current market data. For is an important question on what type of current changes
example, the price of the stock is just its market value are the same as historic changes. The main difficulty is
and the price of the bond is its discounted future pay- to distinguish between multiplicative and additive types
off translated to a local currency according to the current of market variables. We provide here a simplistic scheme
exchange rate. assuming that all changes are additive, for a detailed ex-
Next, we define the pricing functions for the stock in- planation of this problem see [Grundy, Wiener 1996].
dex and the foreign bond. Suppose we are given a list of This procedure pretends that the change in market pa-
market data, market={dayN[{1997,3,6}], 283., rameters from today to tomorrow will be the same as it
5.26, 3.47}. The stock market price is the second item was some time ago. The routine below returns a list of
in this list, whereas the bond price in the local currency is the historical prices. Note that this procedure is completely
given by 100*3.47*exp[-5.26%*(time to maturity in years)]. different from just pricing the current portfolio according
We use Mathematica ’s calendar functions to define two to old data, in which case the global change in the market
dollar pricing functions: level is lost. Parameters of the historical simulation func-
Clear[stock,fbond]
tion are: portf - the current portfolio, mrkt - the current
stock[ param_, market_]:= market[[2]]; market data, histData - the historical data.
fbond[ param_,market_]:=
market[[4]]*100*
histSimul[ portf_, mrkt_, histData_]:=
Exp[-market[[3]]/100*
Module[{histPrice={}, i},
(param[[1]]-market[[1]])/365.25];
For[ i=1, i<Length[histData], i++,
junk={dayN[{1997,8,9}],355.,5.77,6.};
AppendTo[ histPrice,
stock[{},junk]
valueP[portf,
fbond[{1223},junk]
mrkt+histData[[i+1]]-histData[[i]]]
355. ];
];
512.08
histPrice
Next we define ];
pricingFun[instr_]:=
Switch[instr, STOCK,stock, FBOND,fbond] To use this simulation for VaR measurement we use
valueP[ portf_, mrkt_]:= the following function, which requires in addition to the
Module[{valueList, i}, parameters described above the quantile.
valueList =
Table[Apply[ pricingFun[ portf[[i,1]] ],
{portf[[i,2]], mrkt}]*portf[[i,3]], HistApproach[ portf_, mrkt_, hData_, quant_]:=
{i,Length[ portf]}]; Module[{currPrice, histPr, changes},
Apply[ Plus,valueList] currPrice = valueP[ portf, mrkt];
]; histPr = histSimul[ portf, mrkt, hData];
changes = histPr - currPrice;
Check that it works {Quantile[ changes, quant], changes, histPr}
];
mrkt9Feb97 = {40, 293., 5.30, 3.4};
currentPrice = valueP[ portfolio, mrkt9Feb97]
299.63
The outcome of this function is a list of three objects.
The first one is the VaR, the second one is a list of pre-
If everything is correct we should get 299.63 since the tended market changes in the value of our portfolio. The
current value of our stock position is 586 = 2 * 293, and third is a list of resulting portfolio values.
Running this simulation again we get a similar result: ABOUT THE AUTHORS
The authors acknowledge grants from Wolfram Research, the Krueger
SeedRandom[7]; and Eshkol Centers at the Hebrew University, and the Israeli Academy
MCApproachAdd[ portfolio, mrkt9Feb97, of Science. Wiener’s research has benefited from a grant from the Israel
0.2, 1000][[1]] Foundations Trustees, the Alon Fellowship and the Eshkol grant.
-3.76359
Simon Benninga is professor of finance at Tel-Aviv University (Israel) and
the Wharton School of the University of Pennsylvania. He is the author
Discussion
of Financial Modeling (MIT Press, 1997) and of Corporate Finance: A
The historical simulation method is useful when the amount Valuation Approach (with Oded Sarig, McGraw-Hill, 1997); he is also
of data is not very large and we do not have enough in- the editor of the European Finance Review.
formation about the profit and loss distribution. It is usu- Simon Benninga
ally very time consuming, but its main advantage is that Faculty of Management
it catches all recent market crashes. This feature is very Tel-Aviv University, Tel-Aviv, Israel
important for risk measurement. benninga@post.tau.ac.il
http://finance.wharton.upenn.edu/ benninga
The variance covariance method is the fastest. How-
ever it relies heavily on several assumptions about the Zvi Wiener is assistant professor of finance at the business school of the
distribution of market data and linear approximation of Hebrew University of Jerusalem. His finance research concentrates on
the portfolio. It is probably the best method for quick es- the pricing of derivative securities, Value-at-Risk, computational finance
timates of VaR. However one should be very careful when and stochastic dominance. He wrote this article while visiting at the Olin
using this method for a non-linear portfolio, especially in School of Business at Washington University in St. Louis.
the case of high convexity in options or bonds. Zvi Wiener
Finance Department, Business School
The Monte Carlo simulation method is very slow, but
Hebrew University, Jerusalem, Israel
it is probably the most powerful method. It is flexible mswiener@mscc.huji.ac.il
enough to incorporate private information together with http://pluto.mscc.huji.ac.il/ mswiener/zvi.html
historical observations. There are many methods of speed-
ing calculations, so-called variance reduction techniques.
ELECTRONIC SUBSCRIPTIONS
The results of all three methods are similar and our Included in the distribution for each electronic subscription is the file
goal was to demonstrate a very basic approach to risk varisk.nb , containing Mathematica code for the material described
measurement techniques using Mathematica. in this article.