# Random variable for sum of probability densities.

Given two Random Variables: $$X$$ with probability density $$f_X(x)$$ and $$Y$$ with probability density $$f_Y(y)$$, I want to understand the random variable $$Z$$ such that $$Z$$ has probability density $$f_X(z) + f_Y(z)$$. Here, I'm allowing for negative probability densities, and $$f_X$$ and $$f_Y$$ do not necessarily integrate to 1.

NB: I'm not looking for the formula for the pdf of $$Z = X+Y$$, which was answered many times in other posts.

I want to know if there is a way to express $$Z$$ in terms of $$X$$ and $$Y$$. For example, can I find constants $$c_{ij}$$ to say $$Z = \sum_{ij} c_{ij} X^iY^j$$?

Thank You!

EDIT: After reading some comments, it seems like posing this question in terms of $$X$$ and $$Y$$ as random variables doesn't really make sense if $$f_X(x)$$ and $$f_Y(y)$$ are not always positive and do not integrate to 1. So I want to ask the simpler version of this question. If $$f_X(x)$$ and $$f_Y(y)$$ are proper probability density functions, and we have some random variable $$Z$$ with pdf: $$pf_X(z) + (1-p)f_Y(z)$$ where $$p \in [0,1]$$, is there a way to express $$Z$$ in terms of $$X$$ and $$Y$$ (like $$Z = \sum_{ij} c_{ij} X^iY^j$$)?

($$X$$ and $$Y$$ are independent)

• My apologies if I misunderstand your question, but if you don’t require that the individual densities of $X$ and $Y$ each integrate to $1$, then they are, by definition, not probability densities functions... Nov 25 '19 at 20:33
• I don't think you misunderstood, I'm just coming from a physics background and don't have the language quite right. I heard of this idea of using negative probabilities, and It seemed like it was acceptable so long as the sum of (fake) probability density functions is a real pdf (integrated to 1). The idea is that while X and Y may not integrate to 1, Z would. Nov 25 '19 at 20:38
• I see. Another comment I have, but this is mostly to do with terminology, is that PDFs do not represent probabilities: there exist valid PDFs (i.e. satisfying the two properties: $f(x)\geq 0$ and integrating to $1$) that may exceed $1$ for some input values. Consider exponential PDF with $\lambda>1$, ie $f(x)=\lambda e^{-\lambda x}$ at $x=0$. Probability density functions represent exactly that: probabilities per unit; a density but not probabilities proper. Nov 25 '19 at 20:43
• Right. Yes I'll make sure the language is clear. Is there a nice word for a generalized pdf, where $f(x)$ can be negative, and does not have to integrate to 1? Nov 25 '19 at 20:52
• If $f_X$ and $f_Y$ are not probability densities, then there are no random variables $X$ and $Y$, so what are you looking for? Nov 25 '19 at 21:05

The edited question is amenable to standard probability theory: $$Z$$ is a mixture of $$X$$ and $$Y$$. More precisely, let $$B$$ be Bernoulli with parameter $$0, independent of $$X$$ and $$Y$$. If $$X$$ and $$Y$$ have PDFs $$f_X$$ and $$f_Y$$ respectively, then $$Z=BX+(1-B)Y$$ has PDF $$f(z)=pf_X(z)+(1-p)f_Y(z)$$.
(Though it may not be what you desired to have the coefficients $$c_{ij}$$ themselves random...)
• There seems to be an implicit assumption that $X$ and $Y$ are independent. Nov 25 '19 at 22:06
Note that the distribution or density functions of a function of your $$\ X\$$ and $$\ Y\$$ will, in general, depend not merely on their individual density functions, $$\ f_X\$$ and $$\ f_Y\$$, but on their joint distribution or density function, $$\ f_{XY}\$$, assuming that this latter exists. With that qualification, if $$\ \varphi:\mathbb{R}\times\mathbb{R}\rightarrow\mathbb{R}\$$ is any function at all such that $$\ \varphi(X,Y)\$$ has a density $$\ f_\varphi\$$, then the random variable $$\int_{-\infty}^{\varphi(X,Y)}f_\varphi(t)dt$$ will be uniformly distributed.
I have to confess that I have no idea what it means for a random variable $$\ Z\$$ to have a density function $$\ f_X+f_Y\$$ which integrates to a value of $$2$$, rather than $$1$$, but if you define $$F_\text{zinv}(y)=\inf \left\{x\left| \int_{-\infty}^x\left(f_X(t)+f_Y(t)\right) dt\ge 2y\right.\right\}\ ,$$ then the random variable $$Z=F_\text{zinv}\left(\int_{-\infty}^{\varphi(X,Y)}f_\varphi(t)dt\right)$$ will have density function $$\ \frac{f_X+f_Y}{2}\$$.