Prove that if $\eta = \log(\frac{\phi}{1-\phi})$ then $\phi = \frac{1}{1+e^{-\eta}}$

101 Views Asked by At

In the pdf supervised learning from Andrew Ng, p. 23, it is said that if $$\eta = \log(\frac{\phi}{1-\phi})$$ then $$ \phi = \frac{1}{1+e^{-\eta}} $$ I can we prove it step by step?

I tried backward but got stuck \begin{align} \frac{1}{1+e^{-\eta}}&=\phi\\ \implies 1&=\phi(1+e^{-\eta})\\ &= \phi + \frac{\phi}{e^{\eta}}\\ &= \frac{e^{\eta}\phi + \phi}{e^{\eta}}\\ &= \phi\frac{e^{\eta} + 1}{e^{\eta}} \end{align}

Edit (with help of posted answers) \begin{align} 1&= \phi\frac{e^{\eta} + 1}{e^{\eta}}\\ \implies \frac{1}{\phi} &= \frac{e^{\eta} + 1}{e^{\eta}}\\ \implies \phi &= \frac{e^{\eta}}{e^{\eta} + 1}\\ &= \frac{e^{\eta}}{e^{\eta} + 1}\frac{\frac{1}{e^{\eta}}}{\frac{1}{e^{\eta}}}\\ &=\frac{1}{1+ e^{-\eta}} \end{align}

3

There are 3 best solutions below

0
On BEST ANSWER

$$\eta=\log\frac{\phi}{1-\phi}$$

$$\exp\eta=\frac{\phi}{1-\phi}$$

$$(1-\phi)\exp\eta=\phi$$

$$\exp\eta=\phi(1+\exp\eta)$$

$$\phi=\frac{\exp\eta}{1+\exp\eta}$$ $$\phi=\frac{1}{1+\exp(-\eta)}$$

Side note: in statistics, the function $\phi\to\log\frac{\phi}{1-\phi}$ is called the logit function, and $\eta\to\dfrac{1}{1+\exp(-\eta)}$ is called the logistic function. They are used for logistic regression, for instance.

0
On

You’re almost there. So $$\phi=\dfrac{e^{\eta}}{e^{\eta}+1}$$ and then just divide top and bottom by $e^{\eta}$.

0
On

Alternatively, \begin{align}\eta=\log\frac\phi{1-\phi}&\implies-\eta=-\log\frac\phi{1-\phi}=\log\frac{1-\phi}\phi\\&\implies e^{-\eta}=\frac{1-\phi}\phi=\frac1\phi-1\\&\implies\frac1\phi=1+e^{-\eta}\\&\implies\phi=\frac1{1+e^{-\eta}}.\end{align}