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.
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).