1
$\begingroup$

If I want to generate a random variable with such a pdf: $f(x) = \frac{5}{12}[1+(x-1)^4], (0 \leq x \leq 2)$ by composition, what should I do?

Some of my thought is that I can first make it into $f(x) = \frac{5}{6}\frac{1}{2} + \frac{1}{6}[\frac{5}{2}(x-1)^4]$. But I'm not sure how to proceed.

Thanks!

1 Answers 1

2

HINT: You now generate Bernoulli random variable with $p=\frac{1}{6}$. If it is zero, you output uniform random variable on $(0,2)$, otherwise you output random variable with density $\frac{5}{2} (x-1)^4$, which you can generate by inversion method.

  • 0
    Got it :) Inversion method rocks. :)2012-02-29