24
$\begingroup$

I want to know why logistic regression is called a linear model. It uses a sigmoid function, which is not linear. So why is logistic regression a linear model?

$\endgroup$
  • 6
    $\begingroup$ The logit of $\pi$ (the log of the odds) is linear in the parameters, but people don't refer to logistic regression as linear as far as I know. Can you cite who has said this? $\endgroup$ – gung - Reinstate Monica Mar 3 '14 at 18:05
  • $\begingroup$ @gung-ReinstateMonica For example, in the Deep Learning book at page 169 (deeplearningbook.org/contents/mlp.html). In the book they note "Linear models, such as logistic regression and linear regression, are appealing....." I think they meant Generalized Linear Model for logistic regression. $\endgroup$ – YOUNG Nov 27 at 6:45
33
$\begingroup$

The logistic regression model is of the form $$ \mathrm{logit}(p_i) = \mathrm{ln}\left(\frac{p_i}{1-p_i}\right) = \beta_0 + \beta_1 x_{1,i} + \beta_2 x_{2,i} + \cdots + \beta_p x_{p,i}. $$ It is called a generalized linear model not because the estimated probability of the response event is linear, but because the logit of the estimated probability response is a linear function of the predictors parameters.

More generally, the Generalized Linear Model is of the form $$ \mathrm{g}(\mu_i) = \beta_0 + \beta_1 x_{1,i} + \beta_2 x_{2,i} + \cdots + \beta_p x_{p,i}, $$ where $\mu$ is the expected value of the response given the covariates.

Edit: Thank you whuber for the correction.

$\endgroup$
  • 7
    $\begingroup$ If you were to write "generalized linear" instead of "linear" and parameters instead of predictors, this would be correct. (Many logistic regression models are not linear in the predictors. For instance, no logistic regression with an interaction term will be linear in the prdictors.) $\endgroup$ – whuber Mar 3 '14 at 18:42
  • $\begingroup$ You are correct, thank you. I've updated my answer to reflect this. $\endgroup$ – P Schnell Mar 3 '14 at 18:55
  • $\begingroup$ what is Pi there? $\endgroup$ – Aaron Sep 14 '17 at 6:18
7
$\begingroup$

Logistic regression uses the general linear equation $Y=b_0+∑(b_i X_i)+\epsilon$. In linear regression $Y$ is a continuous dependent variable, but in logistic regression it is regressing for the probability of a categorical outcome (for example 0 and 1).

The probability of $Y=1$ is: $$ P(Y=1) = {1 \over 1+e^{-(b_0+\sum{(b_iX_i)})}} $$

$\endgroup$
7
$\begingroup$

Linear means linear in betas (the coefficients) but no in x's (the independent variables), so as long as your betas are not non-linear, your model is linear.

$\endgroup$
  • 3
    $\begingroup$ That's true--but unfortunately logistic regression is a generalized linear model and it is not linear in the parameters. $\endgroup$ – whuber Mar 3 '14 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.