For some data (where I have the mean and standard deviation) I currently estimate the probability of getting samples greater than some x
by using the Q function; i.e., I'm calculating the tail probabilities. But this assumes a normal (Gaussian) distribution of my data, and I may be better off assuming a heavy tailed distribution, like log-normal or Cauchy. How can I calculate the tail probabilities for heavy tailed distributions?
-
$\begingroup$ Why can't you use the q-function for the relevant distribution (eg, Cauchy)? $\endgroup$– gung - Reinstate MonicaJul 15, 2016 at 18:53
-
$\begingroup$ @gung because the Q-function assumes a Gaussian distribution. I'm looking for the similar calculation that doesn't make this assumption, or assumes a different distribution. $\endgroup$– BoltzmannBrainJul 15, 2016 at 19:11
-
1$\begingroup$ Note that the Cauchy doesn't have a mean or variance $\endgroup$– Glen_bJul 16, 2016 at 7:22
-
1$\begingroup$ Q-function appears to be a nonstandard term for survival function $\endgroup$– Glen_bJul 16, 2016 at 7:23
3 Answers
The Wikipedia article you linked shows that the Q-function is just 1 minus the cumulative distribution function (CDF) of the normal distribution. Every distribution has its own CDF. So just use the CDF for the distribution in question. In R, for example, 1 - pcauchy(5)
tells you the probability of getting 5 or more from a standard Cauchy distribution.
-
$\begingroup$ That's precisely what I'm looking for, but do you know if there is the same easy calculation in Python? $\endgroup$ Jul 15, 2016 at 21:17
-
1$\begingroup$ Try SciPy:
import scipy.stats; print 1 - scipy.stats.cauchy.cdf(5)'
$\endgroup$ Jul 15, 2016 at 21:53
One approach is to estimate a tail index and then use that value to plug in one of the Tweedie extreme-value distributions. There are many approaches to estimating this index such as Hill's method or Pickand's estimator. These tend to be fairly expensive computationally. An easily built and widely used heuristic involves OLS estimation as described by Xavier Gabaix in his paper Rank-1/2: A Simple Way to Improve the OLS Estimation of Tail Exponents. Here's the abstract:
Despite the availability of more sophisticated methods, a popular way to estimate a Pareto exponent is still to run an OLS regression: log (Rank) = a−b log (Size), and take b as an estimate of the Pareto exponent. The reason for this popularity is arguably the simplicity and robustness of this method. Unfortunately, this procedure is strongly biased in small samples. We provide a simple practical remedy for this bias, and propose that, if one wants to use an OLS regression, one should use the Rank −1/2, and run log (Rank − 1/2) = a − b log (Size). The shift of 1/2 is optimal, and reduces the bias to a leading order. The standard error on the Pareto exponent is not the OLS standard error, but is asymptotically (2/n)1/2. Numerical results demonstrate the advantage of the proposed approach over the standard OLS estimation procedures and indicate that it performs well under dependent heavy-tailed processes exhibiting deviations from power laws. The estimation procedures considered are illustrated using an empirical application to Zipf’s law for the U.S. city size distribution.
For an opposing view, see Cosma Shalizi's presentation So, You Think You Have a Power Law, Do You? Well Isn't That Special? which states that relying on OLS estimators such as Gabaix proposes is "bad practice." For more mathematical rigor see Clauset, Shalizi, Newman Power-Law Distributions in Empirical Data.
Wiki has a good review of Tweedie distributions which are based on the domain of the tail index. https://en.wikipedia.org/wiki/Tweedie_distribution
In finance what you're trying to do is called "value-at-risk" (VaR). There are many different ways to do VaR, for instance check out Jorion's book, which is a standard reference.
The approach you have taken is called "parametric VaR", i.e. you fit a distribution into your observations, then based on the parameters calculate $F^{-1}(1-\alpha)$, where $F^{-1}$ is the inverse cumulative distribution (CDF) of profits and losses (P&L) and $\alpha$ - significance. For instance, if you were to fit normal distribution and calculate 95% VaR then it would be approximately equal to $\mu-2\sigma$.
So, if you want to use another distribution, then you fit it to data and simply get the inverse CDF of the fitted distribution at a given significance. The popular choice is Student t (location scale) distribution. You have to be careful with Cauchy. As you know it doesn't have moments, which could be an issue in certain applications, such as portfolio optimization.
Now, there are other approaches, e.g. "historical VaR", which is basically a nonparametric (empirical distribution) method. All you need is to get the corresponding percentile of your data set. There's no need to assume or fit a distribution.
-
$\begingroup$ still VaR is useful in normal market conditions which not always appears to be such $\endgroup$– JeeyCiApr 22 at 18:17