0

I am trying to generate random numbers from a two-sided Pareto distribution. The paper I'm replicating states that the following two-sided Pareto density function is used:

$$ 1-f(x) = f(-x) = \frac{1}{2}x^{-3}, \quad \quad \quad x \geq 1 $$

Therefore the cdf $F$ should look like

$$ F(x) = 1 - \frac{1}{2}x^{-3}, \quad \quad \quad x \geq 1$$

What I did was to first create the inverse and plug in uniform random variables, so we have

$$ x = F^{-1}(u) = (2(1-u))^{-1/3} $$

But since we have the restriction $ x\geq 1$ I only generate uniform variables on the interval $ \frac{1}{2} \leq u < 1 $

When sampling via this method in matlab I'm not getting the same results and I'm sure I'm doing something wrong here, I think I'm now sampling from just one side of the probability function and not the other, but I don't know how to do it correct. Can someone help me out?

Xi'an
  • 90,397
  • 9
  • 157
  • 575
  • 2
    Have you graphed $F$? What does it look like for $x\le -1$? – whuber May 28 '19 at 16:14
  • 1
    A generic way to generate values from a two-sided version of *any* distribution $F$ is to generate a value from $F$, then flip a fair coin and negate that value if the coin is tails. Although sometimes there are more efficient methods, this one doesn't cost much more because the coin flip is a fast calculation. – whuber May 28 '19 at 18:47
  • This worked, thank you! – erik530 May 29 '19 at 06:45
  • FWIW, this question is a special case of the one asked at https://stats.stackexchange.com/questions/405776/can-i-make-any-one-tailed-distribution-into-a-two-tailed-distribution-like-this/405869#405869, where several answers are given. My answer includes working general-purpose `R` code. – whuber May 31 '19 at 18:26

1 Answers1

1

The density of a regular Pareto distribution $\mathcal P(a,\alpha)$ is $$f(x) = \frac{\alpha x^{\alpha-1}}{a^\alpha}\,\Bbb I_{(a,\infty)}(x)$$ The symmetric Pareto distribution can be defined by the probability density function $$f(x) = \frac{\alpha |x|^{\alpha-1}}{2 a^\alpha}\,\Bbb I_{(a,\infty)}(|x|)$$ The cdf thus looks like $$F(x)=\int_{-\infty}^x f(x)\,\mathrm{d}x=\begin{cases} \int_{-\infty}^x \frac{\alpha |x|^{\alpha-1}}{2 a^\alpha}\,\mathrm{d}x &\text{if }x<-a\\ \frac{1}{2}+\int_{-\infty}^x \frac{\alpha |x|^{\alpha-1}}{2 a^\alpha}\,\mathrm{d}x&\text{if }x>a\end{cases}$$ That is, $$F(x)=\begin{cases} \frac{ |x|^{\alpha}}{2 a^\alpha} &\text{if }x<-a\\ \frac{1}{2}+\frac{x^{\alpha}}{2 a^\alpha}&\text{if }x>a\end{cases}$$ Inverting this cdf then produces a straightforward random number generator.

Xi'an
  • 90,397
  • 9
  • 157
  • 575