Actuarial Notes

Logistic Regression

Study guide: Exam MAS-I

A Logistic Regression is a generalized linear model for a binary response, in which the response Y_i has a binomial (Bernoulli) distribution with probability of success \pi_i and the link function is the logit. It is a supervised learning method for classifying an observation into one of two classes from its predictors x_{i1}, \ldots, x_{ip}.

The odds of success are \pi_i/(1-\pi_i), and the logit is the natural logarithm of the odds. The logit of the probability of success is

\ln\!\left(\frac{\pi_i}{1-\pi_i}\right) = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_p x_{ip}

  • \beta_0, \beta_1, \ldots, \beta_p are the coefficients, estimated by maximum likelihood.

The logit maps a probability in (0, 1) onto the whole real line, so the linear predictor \eta_i = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_p x_{ip} can take any value. Solving for \pi_i, the probability of success is

\pi_i = \frac{e^{\eta_i}}{1 + e^{\eta_i}}

\pi_i = \frac{1}{1 + e^{-\eta_i}}

This inverse of the logit is the logistic function. It maps any value of \eta_i into (0, 1), so every fitted value is a probability. The probit link, the inverse of the standard normal cumulative distribution function, also maps (0, 1) onto the real line and gives similar fitted probabilities. The logit is the canonical link of the binomial distribution, and the dispersion parameter of the binomial is fixed at \phi = 1.

A logistic regression for the probability that a policy renews has \hat\beta_0 = 1.20 and \hat\beta_1 = -0.03, where x is the rate increase in percent. What is the probability of renewal for a 10\% rate increase?

  • The linear predictor is \hat\eta = 1.20 - 0.03 \times 10 = 0.90.
  • The probability of renewal is \hat\pi = \frac{1}{1 + e^{-0.90}} = \frac{1}{1.4066} = 0.711.

The odds ratio

Exponentiating the logit, the odds of success are

\frac{\pi_i}{1 - \pi_i} = e^{\beta_0}\, e^{\beta_1 x_{i1}} \cdots e^{\beta_p x_{ip}}

A one-unit increase in x_j, with the other predictors held fixed, multiplies the odds by e^{\beta_j}. This factor is the odds ratio of x_j.

In the renewal model above, what are the odds of renewal for a 10\% rate increase, and by what factor does each additional percentage point of rate increase change them?

  • The odds of renewal are e^{\hat\eta} = e^{0.90} = 2.460.
  • Each additional percentage point multiplies the odds by e^{-0.03} = 0.970, a reduction of 3.0\%.

Because the model is linear on the log-odds scale, two fitted probabilities at two values of one predictor fix both coefficients. The slope is the change in log-odds divided by the change in x.

A logistic regression with one predictor gives fitted probabilities of 0.5 at x = 2 and 0.8 at x = 4. What are \hat\beta_0 and \hat\beta_1?

  • At x = 2 the log-odds are \ln(0.5/0.5) = 0.
  • At x = 4 the log-odds are \ln(0.8/0.2) = \ln 4 = 1.3863.
  • The slope is \hat\beta_1 = \frac{1.3863 - 0}{4 - 2} = 0.6931.
  • The intercept is \hat\beta_0 = 0 - 2 \times 0.6931 = -1.3863.
  • The odds ratio is e^{0.6931} = 2, so each unit of x doubles the odds of success.

The linear probability model

The linear probability model fits linear regression to a 0/1 response, so that the probability of success is

\pi_i = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_p x_{ip}

It has three drawbacks that the logit link and the binomial distribution remove:

  1. Fitted values can fall below 0 or above 1, so they are not always probabilities.
  2. The variance of a 0/1 response is \pi_i(1 - \pi_i), which changes with the mean, so the errors are heteroscedastic.
  3. The errors take only two values for each x_i, so they are not normal and residual analysis is not meaningful.

Responses with more than two categories

A response with more than two unordered categories is modelled by multinomial logistic regression. A response with ordered categories is modelled by ordinal logistic regression.

Multiplying the probability by the odds ratio The odds ratio e^{\beta_j} multiplies the odds, not the probability. In the renewal model, an 11\% rate increase gives odds of 2.460 \times 0.970 = 2.387 and a probability of 2.387/3.387 = 0.705. Multiplying the probability instead, 0.711 \times 0.970 = 0.690, is wrong.

Practice questions

Actuarial Notes