TITLE: How to generate a random number from a pareto distribution
QUESTION [7 upvotes]: I'm working on a problem where I am trying to generate a random number from a Pareto distribution.

Using some measured data,  I have been able to fit a Pareto distribution to this data set with shape/scale values of $4/6820$ using the R library fitdistrplus.
Now I want to, using the above scale and shape values to generate random numbers from this distribution.
Doing some searching here (http://www.ntrand.com/pareto-distribution/)  and here (http://www.math.uah.edu/stat/special/Pareto.html), it mentions that the inverse function or quantile function can be used to generate a random number i.e. 

$$x=\frac{b}{(1−U)^{1/a}} \in U(0,1)$$
Using two methods (some C code and Excel formula) I've generated around $1000$ numbers using my shape & scale parameters. However when I import the data back into R and formally validate whether the randomly generated numbers are from a Pareto distribution an Anderson Darling GoF tests tells me that the Pareto distribution is not a good fit, additionally the fitdist library tells me my shape/scale parameters are totally different than the original parameters. (e.g. shape $= 8260157$, scale $= 10834967$)
Any ideas what I am doing wrong here?
Regards
Jonathan

REPLY [2 votes]: If $$U\in [0,1)$$ is uniformly distributed random variable, then $$E(\lambda)=-\ln(1-U)/\lambda$$ is exponentially distributed random variable, and then $$P(x_m,\alpha)=x_m\cdot\exp(E(\alpha))$$ is Pareto distributed random variable with scale $x_m$ and shape $\alpha$. $$L(x_m,\alpha)=P(x_m,\alpha)-x_m$$ generates Lomax distributed random variable.