# Probability density function of a random variable $Z$ given by $Z = f(X,Y)$

Is there a way to derive the probability density function of a random variable Z given by $$Z = f(X,Y)$$ where $$X$$ and $$Y$$ are two independent random variables distributed normally and lognormally respectively and $$f$$ is some arbitrary non-linear function?

I am able to get an idea of the distribution using a Monte-Carlo simulation but I can't seem to find a way to calculate the resulting PDF analytically or at least semi-analytically with some numerical method.

• For an arbitrary function $f$, there is probably no hope of finding of finding the density analytically. – Math1000 Dec 21 '19 at 19:41
• @Math1000 Is there not even some expression that could be evaluated numerically? – Alex G Dec 21 '19 at 19:45
• @AlexG You may find a good approximation of the resulting PDF of $Z$ as a sum of weighted (and shifted) Gaussians. – Nash J. Dec 22 '19 at 0:42

## 1 Answer

Consider the CDF of $$Z$$:

\begin{align} G_Z(z) &= \Pr\{Z \leq z\} \\ &= \Pr\{f(X, Y)\leq z\} \\ &= \int_0^{+\infty} \Pr\{f(X, y)\leq z\}g_Y(y)dy \end{align}

where $$g_Y$$ is the pdf of $$Y$$. Next you would need to find set $$h(y, z)$$ such that $$f(X,y) \leq z \iff X \in h(y,z)$$

You may also consider conditional on $$X$$ in the last step, see if the $$h$$ is more convenient to solve. To find the pdf $$g_Z(z)$$, differentiate both sides with respect to $$z$$:

$$g_Z(z) = \frac {\partial} {\partial z} G_Z(z) = \int_0^{+\infty} \frac {\partial} {\partial z} \Pr\{X \in h(y,z)\}g_Y(y)dy$$

In general $$h$$ is a measurable Borel set, so the probability in the integrand can be expressed as a series of CDF of $$X$$. As long as the set is not singular like Cantor, you should be able to differentiate it. Any the last part is to evaluate the integral numerically (analytically if possible).