## Introduction

NCSU, Dave Garson 有这么一段说明：

“Unlike OLS regression, however, logistic regression does not assume linearity of relationship between the independent variables and the dependent, does not require normally distributed variables, does not assume homoscedasticity, and in general has less stringent requirements. It does, however, require that observations be independent and that the independent variables be linearly related to the logit of the dependent.”

1. 它给人一个印象，就是LR比OLS要更加”nonparametric”, 也就是说假设少。其实这完全是错误的认识。LR是general linear model的一种，它基于一个严格的parametric model，本质上仍然是线性的，只不过是这个线性假设被一个非线性的link function, logit transformation 给藏起来了。 我举一个稍微简单一点的类比，有时候数据拿来了我们要做log transformation对吧？做完log transformation之后我们再做OLS, 我们也可以给它取个漂亮的名字比如说LOLSR (log ordinary least square regression)，那么按照上面那个网站的说法，我们一样可以说LOLSR “does not assume linearity of relationship between the independent variables and the dependent, does not require normally distributed variables, does not assume homoscedasticity”.
2. 这些误导性的说法造成了初学者这么一个映像，只要Y是binary的，那么就用LR, 是连续的，就用OLS regression。特别是LR压根没有模型假设，更不用做goodness of fit 检验。
3. 那么正确的说法是什么？我觉得应该像这样： “Unlike OLS regression, LR (或者我生造出来的那个LOLSR) assumes a transformed linear relationship between the independent and dependent variables; is based on a hidden normal model, and assumes homoscedasticity in a not-so-apparent way.” “In general, it is as much parametric as an OLS model, just in a different way.”
4. 还有一些小一点的错误，比如说 “the independent variables be linearly related to the logit of the dependent.”, 其实应该是X linearly related to logit of the probability of the dependent variable being in the “event” category”. 另外我没有提到的一点，上面的网站还说LR 的参数不能直接解释。这也是不对的，β1 有一个非常直观的几何解释，我下面会谈到。

## The hidden Gaussian model of Logistic Regression

$f(X|Y=0) \sim N(\mu_{0}, \sigma^{2}); \quad f(X|Y=1) \sim N(\mu_{1}, \sigma^{2}).$

1. 男性体重和女性体重都为正态分布;
2. 两者的方差相等(homoscedasticity assumption);
3. 两者的均值不等。

$E(Y|X=x) = P(Y=1|X=x) = p(x) =\frac{\pi_{1}f_{1}(x)}{\pi_{0} f_{0}(x) + \pi_{1}f_{1}(x)},$

$\frac{p(x)}{1-p(x)} = \frac{\pi_{1}f_{1}(x)}{\pi_{0}f_{0}(x)} = \frac{\pi_{1}}{\pi_{0}} \exp\left( \frac{2(\mu_{1}-\mu_{2})x -\mu_{1}^{2}+\mu_{2}^{2}} {2\sigma^{2}} \right),$

$\mathrm{logit}(p(x)) = \beta_{0} + \beta_{1}x.$