Increasing the tail of exponential function

94 Views Asked by At

Suppose I generate a number of random number according to the exponential distribution and convert them into probability values in R.

prob <-  data.frame(round(rexp(2000 ,0.5) , digits = 4))
colnames(prob) <- "V"
prob$V <- prob$V / max(prob$V)
hist(prob$V , prob= TRUE, breaks =30, main=" ", xlab= "Probability Vals", col="red")
lines(density(prob$V, adjust=2), lty="dotted", col="darkblue", lwd=2)

When I plot the distribution of the probability values, here how it looks;

figure

I would like to obtain something like

second figure

I have found something called exponentially modified Gaussian distribution and select the parameters as $\mu= -3, \sigma =1, \lambda =0.25$ as shown at this wiki page. However, I am not getting the desired output. The R code is

prob <-  data.frame(round(rexp(2000 ,0.25)+ dnorm(2000, mean = -3, sd = 1, log = FALSE)   , digits = 4))

I was wondering if someone help me out.

2

There are 2 best solutions below

2
On BEST ANSWER

I gather you want an exponential-like distribution with a constant tail for $x$ which is zero away from the interval $0<x<1$. Such a PDF can be written

$$ P(x) = A \ \text{max}\big[C,e^{-\lambda x}\big]\big[\theta(x)-\theta(x-1)\big]$$

where $C<1$ and $0< 1/\lambda < 1$. $C$ is your constant tail, and the turnover from exponential-like to constant happens at $x = -\lambda^{-1}\log C$ (a positive number between 0 and 1). The normalization constant $A$ is determined by

$$1 = \int_0^1 P(x) dx = A \Big[ \int_0^{-\lambda^{-1}\log C} e^{-\lambda x} dx + \int_{-\lambda^{-1}\log C}^{1} C dx\Big],$$ and this gives $$ A = -\frac{\lambda}{C(1+\log C)}$$ so

$$ P(x) = -\frac{\lambda}{C(1+\log C)} \ \text{max}\big[C,e^{-\lambda x}\big]\big[\theta(x)-\theta(x-1)\big].$$

If you want to draw random variables from this distribution, probably the best way is to sample from an exponential distribution and throw away values that don't work (A Monte Carlo method).

6
On

No matter what distribution you choose it will go to zero as $x$ goes to $\infty$. You could potentially ask that it goes to zero much slower than an exponential distribution, and there are many ways to achieve this. For instance you could choose the cdf to be $1-1/f$, where $f$ is a very slow growing function like $\log x$ or $\log \log x$. (To do this you might have to shift also to make it zero at $x=0$).

Putting this all together for $f = \log \log x$, say, a pdf with qualitatively very large tail is $$ \frac{1}{(x+e^e)\log (x+e^e) \log^2\log (x+e^e)} $$