Solved – PDF of log transformed variable

data transformationdensity functionnormal distribution

I want to know if I've understood log transformation correctly in terms of functions of the distributions.

If $\log(X)$ is normally distributed, then $X$ is lognormally distributed.

Let's say I have a lognormally distributed variable X with PDF
$$f(x)=\frac{1}{x\sigma\sqrt{2\pi}}\exp\left(-\frac{(\log x-\mu)^2}{2\sigma^2}\right) $$
Does this mean that $\log(f(x)) $ is normally distributed?

Best Answer

No, it does not mean that. What you are doing is taking the logarithm of the probability density associated with the random variable $log(X)$. This does not return a probability density - it is typically negative most places as well, even.

What you have is that, if $Z = \log(X) \sim N(\mu, \sigma^2)$, then $\exp(Z) = X \sim \log N(\mu, \sigma^2)$. In other words, we are doing a transformation of the random variable, not the probability density. The probability density of the random variable subsequently changes, however.

One way to get the functional form of the probability density is through the change of variable formula. If $g$ is a monotone function, and you define a random variable as $Z = g(X)$, with $X$ having density $f(X)$, then $$f_g(x) = |\frac \partial {\partial z} g^{-1}(z)| \cdot f(g^{-1}(z))$$

is now the probability density of the random variable $Z = g(X)$. You can try to see if you can arrive at the form of the logarithmic transformation of a lognormal using this formula.