I am struggling to derive the following identities: $$ \mathbb{E}[\log Z]=2\log(\mathbb{E}[Z])-\frac12\log(\mathbb{E}[Z^2]) $$ $$ \mathrm{Var}[\log Z]=\log(\mathbb{E}[Z^2])-2\log(\mathbb{E}[Z]) $$ where $Z$ is a random variable. These are equations (B6) and (B7) in this paper.
-
6$\begingroup$ The linked paper, just before equations (B6) and (B7), says: "The evidence is in practice approximately log-normally distributed. Thus, it is better to report the mean and variance of $\log\mathcal Z$." (Then it says that that mean and that variance are "defined by" equations (B6) and (B7), which follow. "defined" is definitely the wrong word.) At any rate, rather than saying "where $Z$ is a random variable, an accurate report of what was said would say "where $Z$ is a normally distributed random variable." $\endgroup$– Michael HardyCommented Dec 13, 2022 at 21:16
2 Answers
Those apply to a log-normal distribution. The paper says "The evidence is in practice approximately log-normally distributed."
If it has parameters $\mu=\mathbb{E}[\log Z]$ and $\sigma^2=\mathrm{Var}[\log Z]$ then:
- $\mathbb{E}[ Z] = \exp\left(\mu + \frac{\sigma^2}{2}\right)$
- $\mathrm{Var}[Z]=(\exp(\sigma^2)-1)\exp(2\mu+\sigma^2)$
- $\mathbb{E}[ Z^2] =\exp(2\mu+2\sigma^2)$
which leads to the desired
- $2\log(\mathbb{E}[Z])-\frac12\log(\mathbb{E}[Z^2]) = 2\mu+\sigma^2 - \mu-\sigma^2=\mu=\mathbb{E}[\log Z]$
- $\log(\mathbb{E}[Z^2])-2\log(\mathbb{E}[Z]) = 2\mu +2\sigma^2-2\mu-\sigma^2 = \sigma^2=\mathrm{Var}[\log Z]$
$\newcommand{\e}{\operatorname E} \newcommand{\v}{\operatorname{var}}$The paper actually assumes $X= \log\mathcal Z$ is normally distributed, not just that it is some random variable.
Let $\mu=\e(X) = \e(\log\mathcal Z)$ and $\sigma^2 = \v(X) = \v(\log\mathcal Z).$
Then $\mathcal Z=e^X = \exp(X)$ and \begin{align} \e(\mathcal Z) = {} &\int_{-\infty}^{+\infty} (\exp x) \varphi_{\mu,\sigma^2}(x) \,dx \\ & \text{where } \varphi_{\mu,\sigma^2} \text{ is the normal} \\ & \text{density with expectation $\mu$} \\ & \text{and variance $\sigma^2$.} \\[8pt] = {} & \int_{-\infty}^{+\infty} (\exp x) \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12 \left( \frac{x-\mu} \sigma \right)^2 \right) \,\,\frac{dx}{\sigma} \\[8pt] = {} & \int_{-\infty}^{+\infty} (\exp(\mu + \sigma w)) \frac 1 {\sqrt{2\pi}} \exp \left( -\frac 12\,w^2 \right)\, dw \\[8pt] = {} & \int_{-\infty}^{+\infty} \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12 w^2 + \sigma w + \mu \right) \, dw \\[8pt] = {} & \int_{-\infty}^{+\infty} \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12\left( w^2 - 2\sigma w \right) + \mu \right) \, dw \\[8pt] = {} & \int_{-\infty}^{+\infty} \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12\left( w^2 - 2\sigma w + \sigma^2 \right) + \mu + \frac12\sigma^2 \right) \, dw \\ & \text{This is completing the square.} \\[8pt] = {} & \int_{-\infty}^{+\infty} \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12(w-\sigma)^2 \right) \underbrace{ \exp\left( \mu + \frac12\sigma^2 \right) }_\text{No “$w$” appears here!} \, dw \\[8pt] & \text{The absence of $w$ from the expression above} \\ & \text{the $\underbrace{\text{underbrace}}$ means that that can be pulled out:} \\[8pt] = {} & \exp\left( \mu + \frac12\sigma^2 \right) \int_{-\infty}^{+\infty} \frac 1 {\sqrt{2\pi}} \exp\left( -\frac12(w-\sigma)^2 \right) \, dw \\[8pt] = {} & \exp\left( \mu + \frac12\sigma^2 \right) \cdot 1 \end{align} That last integral is equal to $1$ because it is the integral of the normal density with expectation $\sigma$ and variance $1.$
We will also need $\e(\mathcal Z^2).$ Notice that $$ \Big( \exp(\mu+\sigma w) \Big)^2 = \exp(2\mu + 2\sigma w). $$ So the random variable $\mathcal Z^2= \exp(2X)$ has values of $\mu$ and $\sigma$ that are twice as big; hence we have $$ \e(\mathcal Z^2) = \exp\left(2\mu + \frac12(2\sigma)^2 \right). $$ So \begin{align} & \log\e(\mathcal Z) = \mu + \frac12 \sigma^2, \\[8pt] & \log\e(\mathcal Z^2) = 2\mu + \frac12(2\sigma^2) = 2\mu + 2\sigma^2, \\[8pt] \text{and so } \mu & = \e(\log\mathcal Z) = 2\log\e(\mathcal Z) - \frac12 \log\e(\mathcal Z^2) \\[8pt] \sigma^2 & = \v( \log\mathcal Z) = \log\e(\mathcal Z^2) - 2\log\e(\mathcal Z). \end{align}