# Avoiding large variances when taking the logs of small values

I have two random variables $(X$ and $Y)$ that are always positive. The assumption I'm making is that their logs follow normal distributions (i.e., $N(\overline{\log(X)},s^2_{\log(X)})$ and $N(\overline{\log(Y)},s^2_{\log(Y)})$) . I'm interested in the difference between them, and therefore I'm assuming that the difference of their logs is also normally distributed $(\log(X)-\log(Y) = \log(X/Y) \sim N(\overline{\log(X/Y)},s^2_{\log(X/Y)})$).

My problem is that $X$ and $Y$ can take values that are very close to $0$ (as small as $10^{-30})$, and in that case the variances of their logs become extremely large. For example, if the mode of $X$ is around $10^{-4}$, but $X$ has a left tail down to $10^{-30}$ and a right tail up to 1.5, its log will have a huge variance and obviously also that of $\log(X)-\log(Y)$.

My questions is how to deal with this. Probably something in the lines of adding a constant to $X$ and $Y$, but I'm not sure what that constant should be. I thought of adding an $\epsilon$, but that won't help the case of the example of $X$ I mention above.

• What are you measuring with ~30 orders of magnitude precision?
– user32490
Mar 25, 2014 at 3:49
• These are samples from posterior distributions of gene expression levels. So for X, the expression is very close to 0. Mar 25, 2014 at 3:59
• It seems like the assumption that the logs follow normal distributions must be doubted. Mar 25, 2014 at 4:35
• +1 to @Glen_b but is "doubted" strong enough? Mar 25, 2014 at 10:28