Sunday 17 November 2013

VaR I: What is it? Basic setup



Will I go bankrupt tomorrow? This question bothers many a business. When your a big business, it can be hard to come to grips with all that is you. This may sound strange for those who own a small business, say, a doughnut stand. But when your business is a sizable conglomerate, then it becomes hard to see how likely it is that failures across the different parts results in a failure of the whole company. The exact question really is: How much liquid freed-up cash do I have to keep in hand so that I can survive bad shit happening tomorrow.

How do you go about answering this? Here's an idea: let's try and conjure-up what's the worst thing that can happen tomorrow, then we'll check to see if the biz could survive. You think some more, and realize that the worst thing possible is anything from earthquakes, to a rather unlikely quantum event that teleports all of your assets into outer space. Not very useful. So let's try and rule out these truly extreme events. Instead, let's focus on the worst possible event, removing the \(1\%\) worst event. That's the idea behind Value at Risk also abbreviated to VaR (which is unfortunate as variance has already called dibs on the abbreviation VAR.) We abbreviate as \(VaR_{99\%}\) the worst possible outcome ignoring the worst \(1\%\).

A few of you, with hippie tendencies, might already be saying ``but....ohhhhhhh....the \(1\%\) worst cases is where shit really gets messed-up, world wide crisis style, and this silly VaR thing ignores it!''. Yes, VaR has no place measuring the occurrence of massively bad things happening. Instead, VaR just prepares you to deal with the next day when business is as usual. Think of a bank putting aside cash everyday so that it's clients can get their grubby hands on it through cash machines. Well, how much should the b-man put aside everyday? Everything just in case everybody wants some bling bling? But then the big-b can't invest. VaR of \(99\%\) of the amount of cash withdrawals is probably safe enough (ok, \(1\%\) of the time, some douche is not gonna get his dough).

I will address the basic concepts behind the VaR of a single asset, then move onto aggregating VaR across assets and practical methods for calculating it.

VaR of a single asset
 We start by naming things. Let \(p_t\) be the price of your single asset at time \(t\), thus \(p_t \in \mathbb{R}^+\). Let \(t\) be today*. Furthermore, let the return \(\mathrm{r}_t\) from today to tomorrow be defined by
\begin{equation*}
p_t(1+ \mathrm{r}_t) = p_{t+1}.
\end{equation*}

Thus the future value \(p_{t+1}\) can be completely determined by knowing the price today and today’s daily return. For this reason, VaR concepts focus on return instead of absolute price. It also puts things in perspective, for stuff has values of different order, e.g, a cow can be cost $1000 while a single olive can be quite cheap. Return, on the other-hand, is something typically between \(-100\%\) and \(100\%\). Isolating return in~(\ref{linret_did}), we have
\begin{equation} \label{linret_did}
 \mathrm{r}_t= \frac{p_{t+1}}{p_t} -1.
\end{equation}

A few of you might read this and argue: Hey, that's not how I define return. Yes, return can be defined in a number of ways that gives us this notion of ``how much did the value of my stuff change''. In fact, let's also define the logreturn, which, as it's name sort of suggests
\begin{equation} \label{logret_did}
\ell_t := \log\left(\frac{p_{t+1}}{p_t}\right) \quad (\mbox{same as saying})\quad p_{t+1} = p_te^{\ell_t}.
\end{equation}

To determine the worst possible return tomorrow, excluding the \(1\%\) worst, we need to assume some sort of distribution for \(\mathrm{r}_t\) as it is unknown to us. We will model this uncertainty with standard probability theory.  In this model, we need a probability measure \(\mathbb{P}\left(\right)\) that says how probable an event is, and a probability distribution for \(\mathrm{r}_t\)**. The question of picking a distribution for \(\mathrm{r}_t\) is in itself a tricky one, but assume for now we are given the c.d.f (cumulative distribution function)  \(F_{\mathrm{r}_t}: \mathbb{R} \rightarrow \mathbb{R}^+\) which is defined for each \(r \in \mathbb{R}\) as
\[F_{\mathrm{r}_t}(r) := \mathbb{P}\left( \mathrm{r}_t \leq r\right),\]
so it's a function that given a possible return \(r\), it tells us how likely is it that today’s return is at most \(r\). \(VaR_{99\%}\) is the cut-off return \(r_{1\%}\), such that the \(1\%\) worst returns are  below \(r_{1\%}.\)  In other words,  we want to find \(r_{1\%} \in \mathbb{R}\) such that \(F_{\mathrm{r}_t}(r_{1\%}) = 1\%.\) Thus \(VaR_{99\%}\) can be defined precisely as
\begin{equation} \label{VaRcont}VaR_{99\%} = F_{\mathrm{r}_t}^{-1}(1\%) = r_{1\%},\end{equation}
where \(F_{\mathrm{r}_t}^{-1}\) is the inverse of the cdf of \(\mathrm{r}_t.\)

Sometimes we will not be working directly with the return \(\mathrm{r}_t\), but instead, we will know the distribution of the logreturn~\eqref{logret_did}. So let's figure out what is \(\mathbb{P}\left(\mathrm{r}_t \leq r\right)\) in terms of logreturn. First we substitute \(\mathrm{r}_t\) for it's definition~\eqref{linret_did} to find
\begin{align}
\mathbb{P}\left( \mathrm{r}_t \leq r\right)  & = \mathbb{P}\left( p_{t+1}/p_t -1 \leq r\right) \quad \left(\mbox{Sum \(1\) to both sides of inner inequality}\right) \nonumber \\
& =  \mathbb{P}\left( \log(p_{t+1}/p_t) \leq \log(r+1)\right) \quad (\mbox{Apply log inside }\mathbb{P}\left(\right)) \nonumber\\
 & =  \mathbb{P}\left( \ell_t \leq \log(r+1)\right) \quad (\mbox{Using definition~\eqref{logret_did}}) \nonumber \\
& = F_{\ell_t} \left( \log(r+1) \right),\label{cdflogret}
\end{align}
where \(F_{\ell_t}\) is the cumulative distribution function of the logreturn \(\ell_t\). Again, remember that VaR of \(99\%\) is equal to a certain \(r_{1\%}\) that sets \(\mathbb{P}\left( \mathrm{r}_t \leq r_{1\%}\right) = 1\%.\) From~\eqref{cdflogret}, this is equivalent to finding
\[F_{\ell_t} \left( \log(r_{1\%}+1) \right) = 1\%. \]
Applying the inverse of \(F_{\ell_t}\) to both sides (and assuming we can do this!) we find

\[
\log(r_{1\%}+1)  = F_{\ell_t}^{-1}(1\%).
\]
Isolating \(r_{1\%}\) we find
\begin{equation}\label{VaRlogret}
 VaR_{99\%} = r_{1\%} = e^{F_{\ell_t}^{-1}(1\%)} -1.
\end{equation}


 But this is not always possible for all possible distribution functions and will depend on what exactly are the cdfs \(F_{\ell_t}\) and \(F_{\mathrm{r}_t}.\) Let's break this down by what we are assuming about our asset so that we may calculate VaR. Now move onto  VaR II: Parametric normal and lognormal


* We'll think in terms of days, but really we can choose the refinement of time, say nano-seconds you trader junkies?
** Formally, we would need the whole measure space set-up, i.e., name a space of events for \(\mathbb{P}\) that has enough events. If you would like a more measure theoretical rigor, comment on the post.

No comments:

Post a Comment