In the following paragraph we want to show how M D *ReX might be used in order to analyze the VaR using copulas as described in Chapter 2 of this book. Subsequently we will demonstrate the analysis of implied volatility shown in Chapter 6. All examples are taken out of this book and have been accordingly modified. The aim is to make the reader aware of the need of this modification and give an idea how this client may be used for other fields of statistical research as well.
We have willingly omitted the demonstration of dialogues and menu bars as it is pretty straightforward to develop these kind of interfaces on your own. Some knowledge of the macro language Visual Basic for Applications (VBA) integrated into Excel and an understanding of the XploRe Quantlets is sufficient to create custom dialogues and menus for this client. Thus no further knowledge of the XploRe Quantlet syntax is required. An example is the aforementioned Time Series dialogue, Figure 18.3.
The quantification of the VaR of a portfolio of financial instruments has
become a constituent part of risk management. Simplified the VaR is a quantile
of the probability distribution of the
value-loss of a portfolio (Chapter 2).
Aggregating individual risk positions is one major concern for risk analysts.
The
approach of portfolio management measures risk in terms of
the variance, implying a "Gaussian world" (Bouyé et al.; 2001). Traditional VaR
methods are hence based on the normality assumption for the distribution of
financial returns. Though empirical evidence suggests high probability of
extreme returns ("Fat tails") and more mass around the center of the
distribution (leptokurtosis), violating the principles of the Gaussian
world (Rachev; 2001).
In conjunction with the methodology of VaR these problems seem to be tractable with copulas. In a multivariate model setup a copula function is used to couple joint distributions to their marginal distributions. The copula approach has two major issues, substituting the dependency structure, i.e. the correlations and substituting the marginal distribution assumption, i.e. relaxation of the Gaussian distribution assumption. With M D *ReX the user is now enabled to conduct copula based VaR calculation with Excel, making use of Excel's powerful graphical capabilities and its intuitive interface.
The steps necessary are as follows:
The first step is rather trivial: copy and paste the example Quantlet
XFGrexcopula1.xpl
from any text editor or browser into an Excel worksheet.
Next mark the range containing the Quantlet and apply the Run command. Then switch to any empty cell of the worksheet and click Get to receive the numerical output rexcuv. Generating a tree-dimensional Excel graph from this output one obtains
an illustration as displayed in Figure 18.4. The according Quantlets
are
XFGrexcopula1.xpl
,
XFGrexcopula2.xpl
,
XFGrexcopula3.xpl
and
XFGrexcopula4.xpl
. They literally work the same way as the
XFGaccvar1.xpl
Quantlet.
![]() |
Of course the steps 1-4 could easily be wrapped into a VBA macro with suitable dialogues. This is exactly what we refer to as the change from the raw mode of M D *ReX into the "Windows" like embedded mode. Embedded here means that XploRe commands (quantlets) are integrated into the macro language of Excel.
The Monte Carlo simulations are obtained correspondingly and are depicted in
Figure 18.5. The according Quantlet is
XFGrexmccopula.xpl
.
This Quantlet again is functioning analogous to
XFGaccvar2.xpl
. The
graphical output then is constructed along same lines: paste the corresponding
results z11 through z22 in cell areas and let Excel draw a
scatter-plot.
A basic risk measure in finance is volatility, which can be applied
to a single asset or a bunch of financial assets (i.e. a portfolio). Whereas
the historic volatility simply measures past price movements the
implied volatility represents a market perception of uncertainty. Implied volatility is a contemporaneous risk measure which is obtained by reversely solving an option pricing model as the Black-Scholes model for the volatility. The implied volatility can only be quantified if there are options traded which have the asset or assets as an underlying (for example a stock index). The examples here are again taken out of Chapter 6. The
underlying data are VolaSurf02011997.xls, VolaSurf03011997.xls
and
volsurfdata2
. The data has been kindly provided by
M
D
*BASE
.
volsurfdata2
ships with any distribution of
XploRe
. In our case the reader
has the choice of either importing the data into Excel via the data import
utility or simply running the command
data=read("volsurfdata2.dat"). For
the other two data sets utilizing the Put button is the easiest way to
transfer the data to an XQS. Any of these alternatives have the same effect,
whereas the former is a good example of how the
M
D
*ReX
client exploits the various
data retrieval methods of Excel.
The Quantlet
XFGReXiv.xpl
returns the data matrix for the implied
volatility surfaces shown in Figure 18.6 through
18.8. Evidently the Quantlet has to be modified for the
appropriate data set. In contrast to the above examples where Quantlets could
be adopted without any further modification, in this case we need some redesign
of the
XploRe
code. This is achieved with suitable reshape operations of the
output matrices. The graphical output is then obtained by arranging the two
output vectors x2 and y2 and the output matrix z1.
The advantage of measuring implied volatilities is obviously an expressive visualization. Especially the well known volatility smile and the corresponding time structure can be excellently illustrated in a movable cubic space. Furthermore this approach will enable real-time calculation of implied volatilities in future applications. Excel can be used as a data retrieval front end for real-time market data providers as Datastream or Bloomberg. It is imaginable then to analyze tick-data which are fed online into such an spreadsheet system to evaluate contemporaneous volatility surfaces.