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?

  • 1
    $\begingroup$ The logarithm of a density is just that, the logarithm of a density. For example a normal density is quadratic (parabolic) on log scale which is sometimes useful. Other densities can be linear on log scale, which is often useful. But as pointed out the logarithm of a density isn't another density. $\endgroup$ – Nick Cox Jun 3 at 13:10

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.

  • $\begingroup$ Does it mean that if I start with a lognormally distributed variable X with the PDF f(x) and I replace log(x) with y and x with e^y, then f(y) will be normally distributed? $\endgroup$ – Marcela Jun 3 at 14:30
  • 2
    $\begingroup$ You still need to keep a clear distinction between a density of a random variable, and the random variable itself. If $X \sim \log N(\mu, \sigma^2)$, and you take the logarithm of $X$, this new variable, which we call $Y$ now, has distribution $Y \sim N(\mu, \sigma^2)$. $f(y)$ is a function, it is not distributed as anything - it is the density of a random variable we call $y$. $\endgroup$ – Forgottenscience Jun 3 at 15:09
  • $\begingroup$ I know the change of variable formula and approach. However, i don't have a mathematival background so I am still strugggling to understand the probability density. If I have a dataset that empirically is lognormally distributed and I log transform the variable and plot it, I will see a normal distribution. If I do the same thing but with formulas, starting with a lognormal density and then take the log of the rv, the plot should look like a normal distribution. However, using the change of variable approach the pdf will be identical to a LN density function not a N density function. $\endgroup$ – Marcela Jun 5 at 9:38
  • $\begingroup$ You are still confusing things, I don't think it is a mathematical issue per se. Forget about data - there is no data, just random variables and their associated densities. Each random variable $X$ has an associated density we denote by $f(x)$. Your statement, "if I do the same thing with formulas" is meaningless: You say "starting with lognormal density" and then "take the log of the rv", and then some plot (of what? the density?) should look like the normal distribution. The density is NOT the random variable. Transforming the random variable is NOT the same as transforming the density. $\endgroup$ – Forgottenscience Jun 5 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.