Logistic regression - Transposing formulas

306 Views Asked by At

I am trying to understand the math behind Logistic regression. I am confused about transposing one formula to another.

Here is what I have: Our regression formula $$\ y = b_0 + b_1x$$

Our sigmoid function

$$\ p = \frac{1}{1+e^{-y}}$$

Our logistic function

$$\ ln(\frac{p}{1-p}) = b_0 + b_1x$$

From what I understand, we have to solve for y using the sigmoid function. I did this:

  1. $$\ p = \frac{1}{1+e^{-y}}$$
  2. $$\frac{1}{p} = 1+e^{-y}$$
  3. $$\frac{1}{p}-1 = e^{-y}$$
  4. $$\ln(\frac{1}{p}-1) = ln(e^{-y})$$
  5. $$\ln(\frac{1}{p}-1) = -y$$
  6. $$\ -ln(\frac{1}{p}-1) = y$$ 6 is y for our logistic function, but I don't see how can we get to our logistic function y $$\ ln(\frac{p}{1-p})$$

Can anyone help me transpose this or point me in the right direction?

If anyone downvotes me, please explain why in a comment.

1

There are 1 best solutions below

1
On BEST ANSWER

$$-\log (\frac1p-1)=-\log(\frac{1-p}{p})=\log(\frac{p}{1-p})$$