3
$\begingroup$

I would like to generate random numbers $X$'s from a desired distribution whose properties should meet the following requirements:

  1. $X \in [0, \infty) $

  2. The mean of the r.v. is around 1, i.e., $\mathbb{E}[X] \approx 1$

  3. The distribution shows "long tail". "Long tail" in the sense that satisfies the typical description: https://en.wikipedia.org/wiki/Long_tail

  4. To be more quantitative, let's say at least $P(X \gt 5) = 0.1$

  5. Although it's possible to combine multiple distributions to achieve the above goals, I was looking for a single distribution that can be written as a compact, closed-form probability density function.

In words, I was looking for a distribution whose mode or mean is around 1 and has fat tail that extends to large values. Can you suggest a distribution that satisfies these properties?

(It's possible that this is naive and no such distribution exists.)

The closest candidate came to my mind is $\chi^2$ distribution, which is controlled by the parameter $k$. However, it's either the mean is too high or the tail probability is too low. Below is an example of $\chi^2(k=3)$. Ideally I would like to move the mean to 1, and make the tail "fatter".

enter image description here

A use case would be to use this distribution as a random number generator, such that the mean of the generated numbers is around 1 while being able to generate large numbers.


Just wanted to point out that, although what @stans suggested to choose log-normal distribution with $\mu = -\sigma^2/2$ satisfies the requirement of $\mathbb{E}[X] = 1$, it doesn't create enough tail probability.

In fact, in order to satisfy the mean=1 condition, $\mu$ needs to be shifted to the very left so that the tail probability $P(X>5)$ gets squeezed smaller. Doing a grid search in the range $\sigma \in [1, 8]$, it seems that the largest tail probability happens around $\sigma=1.79$, at which $P(x>5) \approx 0.036$

enter image description here

Python code to generate log-normal distribution and the corresponding $P(X>5)$:

import numpy as np
import scipy.stats

sigma = 1
mu = -0.5 * sigma**2

s = sigma  
scale = np.exp(mu)

tail_prob = 1.0 - scipy.stats.lognorm(s=s, scale=scale).cdf(5)
$\endgroup$
14
  • 3
    $\begingroup$ You could scale your chi-square -- choose a smaller d.f. say 1, and then scale it up to get the mean right; equivalently, take a gamma density with rate=shape (which makes the mean 1), and you then vary the shape parameter to give whatever tail property you need (lower shape = heavier) $\endgroup$
    – Glen_b
    Jan 22, 2018 at 22:49
  • 1
    $\begingroup$ Actually that won't work for the specific proportion you asked for, sorry; the biggest proportion above 5 you can get with a gamma density whose mean is 1 is about 0.0586; this happens when the shape is just above 0.1053. You can get a heavier tail (in the more usual senses) by making the shape smaller, but that will reduce the proportion above 5. $\endgroup$
    – Glen_b
    Jan 22, 2018 at 23:35
  • 1
    $\begingroup$ This question is starting to look too open-ended. To see why, consider that the distribution that assigns probability $9/10$ to $0$ and probability $1/10$ to $10$ has a mean exactly $1$ and exactly satisfies your constraint--but otherwise looks almost nothing like your plots. Could you focus this question to include (a) what you really mean by "long-tail" or "fat tail" and (b) what additional criteria you are thinking of that would narrow the scope of possible answers to something reasonable? $\endgroup$
    – whuber
    Jan 25, 2018 at 21:30
  • 2
    $\begingroup$ @DJ Those don't seem relevant to the question, since neither has an expectation at all. How were you thinking of applying them? $\endgroup$
    – whuber
    Jan 25, 2018 at 21:56
  • 1
    $\begingroup$ Re the edit to clarify "long tailed": this implies you could take literally any long-tailed distribution $G$ with a finite expectation, scale and shift it as appropriate to put a tenth of its probability to the right of $5$ with a mean of $10$, and mix it with an atom at $0$ to produce what you want. In other words, the set of answers to your question is no smaller than the set of all finite-expectation long-tailed distributions! That's not enough information to recommend a procedure to generate random numbers. Perhaps you could tell us what you're hoping to model with $X$? $\endgroup$
    – whuber
    Jan 26, 2018 at 17:46

2 Answers 2

7
$\begingroup$

Log-normal for the right choice of $\mu$ and $\sigma$. In other words, if $X$ ~ $\rm{LN}(\mu,\sigma^2)$ then

$ 1 = \rm{E}[X] = \exp\{\mu + \sigma^2/2\}\ \ \ \ <=>\ \ \ \mu = -\sigma^2/2. $

Parameter $\sigma$ means "tail fatness" and can be set arbitrarily high.

$\endgroup$
7
  • $\begingroup$ @stans Yours can't work for the specific proportion requested for the same reason my gamma (in comments) didn't -- while you do make the tail heavier (in the more usual senses) by making $\sigma$ higher, you cannot achieve even $0.0364$ in the tail beyond $5$ with a mean-1 lognormal, let alone anything as big as $0.1$. The biggest tail proportion beyond $5$ occurs when $\sigma$ is just below $1.7941226$. In fact to get so large a proportion beyond $5$ you'll probably need a fairly light-tailed distribution. $\endgroup$
    – Glen_b
    Jan 22, 2018 at 23:45
  • $\begingroup$ @Glen_b Thank you for the calculation. I guess, your and my suggestions can be made heavier in the tails by considering mixtures of respective distributions. Mixing over the scale parameter may push us far enough. $\endgroup$
    – stans
    Jan 23, 2018 at 5:33
  • $\begingroup$ If the aim is to get a high proportion beyond a particular value, it may be better(as I suggest above) to look at lighter tailed distributions, not heavier-tailed. Mixtures will work either way (i.e. can generate both lighter and heavier tailed distributions). ... I think your answer is still the kind of thing the OP is after -- it seems like the specific proportion beyond 5 was somewhat arbitrary. $\endgroup$
    – Glen_b
    Jan 23, 2018 at 5:54
  • $\begingroup$ @Glen_b thanks for your comments! I think what stans suggested did meet my goal. For example, a log-Normal with \mu=-2.0 and \sigma=2.0 with result in a distribution that has E(X)=1 and Prob(X > 5) = 0.17. $\endgroup$
    – cwl
    Jan 23, 2018 at 15:55
  • $\begingroup$ @cwl That's odd. I get about 0.0356 when I do it in R: > pnorm(log(5),-2,2,lower.tail=FALSE) $\:\qquad$ $\:$ [1] 0.03555934 ... or if we work directly with the lognormal: plnorm(5,-2,2,lower.tail=FALSE), which gives the same output. $\endgroup$
    – Glen_b
    Jan 23, 2018 at 22:09
0
$\begingroup$

How about a random variable which takes values 1/2p with probability p and 1/(2-2p) with probability 1-p? The mean is always 1. The min is 0, but the max is arbitrary.

If a condition is needed so that the range in unbounded, create a mixture where this variable is the shift for an Exponential 1 random variable.

$\endgroup$
3
  • $\begingroup$ That's not a long-tailed distribution in any standard sense of the word. Objections to this solution have already been expressed in comments to the question. $\endgroup$
    – whuber
    Jan 26, 2018 at 18:47
  • $\begingroup$ @whuber It is a rather lengthy discussion, and nonetheless the numerous edits have not precluded this as a viable answer. I do note you previously posited this kind of distribution, perhaps as a strawman. I think we are in agreement that there is a lack of a rigorous definition here. $\endgroup$
    – AdamO
    Jan 26, 2018 at 19:00
  • 1
    $\begingroup$ The Wikipedia reference included with the latest edit, although it does not provide a technical definition, makes it reasonably clear that bounded distributions won't suffice. I have pointed out that despite the requirements of the question, the answers are still completely open-ended and I have (therefore) asked the OP to try to focus the question more. $\endgroup$
    – whuber
    Jan 26, 2018 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.