# How to compute recursive pdf

1. Jul 2, 2009

### benjaminmar8

Hi,all,

I have a problem of computing pdf of some random variables. Assuming x1, x2.... xN are some random variables. Now, I know the pdf of x1, which is f(x1). For the pdf of x2, it is given as a function of x1, in this case, how do I compute pdf of x2? Or, rather, how do I generate samples from f(x2)?

Thks

Last edited: Jul 2, 2009
2. Jul 2, 2009

### mXSCNT

One way is simply to generate a sample from x1, and compute what it gets transformed to in x2.

3. Jul 2, 2009

### bpet

If you *have* to get the pdf of x2, the easiest way is to use the cumulative distribution and then take the derivative.