It has been pointed out to me that the notation I’m using in class for the sigmoid function is different than what the book uses on p. 139.
In class, I said:
$$\sigma(z) = \frac{1}{1 + e^{-z}}$$
where z is the logit that logistic regression calculates for a data point x:
$$z = \beta_0 + \beta_1 x$$
Two differences between this notation choice and the book. First, realize that these two things are equivalent:
$$\frac{1}{1 + e^{-z}} = \frac{e^{z}}{1 + e^{z}}$$.
(Just multiply top and bottom by $e^{z}$ and rearrange terms.) I like the left side better because it seems slightly less cluttered, and the book uses the right side for whatever reasons. But these two expressions are exactly equivalent.
Second, the book does my two steps all in one fell swoop, giving this equation at bottom of p.139:
$$p(X) = \frac{e^{\beta_0 + \beta_1 X}}{1 + e^{\beta_0 + \beta_1 X}}$$
This is exactly the same as
$$\sigma(z) = \sigma(\beta_0 + \beta_1 X) = \frac{1}{1+e^{-(\beta_0 + \beta_1 X)}}$$
which matches what we had in class.
This has been a public service announcement.


