Generating Random Sample

#1
I know that R can easily generate random samples for know distributions - normal, exponential, uniform. But how can I generate a random sample from a known probability distribution (that is not listed)?

The probability distribution is rather simple: f(x) = 2x^-3

So, how can I generate a random sample of X's that come from this distribution?

Thank you!
 

Dason

Ambassador to the humans
#2
You need to specify the support of the distribution. But one way to generate random samples from generic probability distributions is using inverse transform sampling.

Other general ways would be rejection sampling, Generating some sort of markov chain that converges to your distribution, figuring out some way to transform a different variable to get a random variable with the distribution of interest.... the list goes on.