0

I have a Random Variable $X$ whose PDF is not any of the standard distributions. Then, for the product of the random variable by itself say,

$Z=X^2$, I can find the PDF manually. But, I have to solve for $20$ such PDFs which is becoming very tedious job. So, can I use MATLAB to find it? If not what is the software should I use to do it? And, please tell me how to do it.

Thanks in advance.

  • Do you have the PDF of X in closed form? Are you looking for an answer in closed form? – Godfather Nov 02 '18 at 18:51
  • Yes, here the PDF of $X$ is closed and is actually derived from summation of other two Random variables which I have as an input. And yes, am also looking for the closed form PDFs for the results of PDFs of $Z$. – kunarapu priyatham Nov 03 '18 at 01:44

1 Answers1

1

We can derive a general formula for the PDF of $Z = X^2$, given the PDF of $X$ (denoted $f_X(x)$). Let's first compute the CDF of $Z$:

$F_Z(z) = \mathbb{P}(Z \leq z) = \mathbb{P}(X^2 \leq z) = \mathbb{P}(X \in [-\sqrt{z}, \sqrt{z}]) = \int_{-\sqrt{z}}^{\sqrt{z}} f_X(x) dx$.

We can differentiate the above expression w.r.t. $z$ to derive the PDF of $Z$ (of course, this is not completely rigorous and I am making assumptions about differentiability etc. here). In any case, we get:

$f_Z(z) = \frac{d}{dz}\int_{-\sqrt{z}}^{\sqrt{z}} f_X(x) dx = \frac{f_X(\sqrt{z}) + f_X(-\sqrt{z})}{2 \sqrt{z}}$.

Since you know $f_X(\cdot)$, you can evaluate $f_Z(\cdot)$ numerically in MATLAB or even analytically. You can also simplify the expression further if you know that $X$ is one-sided (e.g. exponential) or symmetric (e.g. Guassian).

Godfather
  • 2,355
  • Yes, I also evaluated my manual results analytically in MATLAB. But, I want to know whether MATLAB or any other software can do it for me by just giving inputs and render output in a closed from. – kunarapu priyatham Nov 03 '18 at 01:47
  • 1
    @kunarapupriyatham no. There is no such software yet and none that can "automatically" find forms for products or any other operations with random variables. – Bruna w Nov 03 '18 at 10:35