Exploring OLS and GLM Models: Understanding the Link Function and Coefficients

  • #1
fog37
1,568
108
TL;DR Summary
OLS in GLM models...
Hello,

I know this is a big topic but I would like to check that what I understand so far is at least correct. Will look more into it. GLM is a family of statistical models in which the coefficients betas are "linear". The relation between ##Y## and the covariates ##Xs## can be nonlinear (ex: polynomial regression and logistic regression). The relation we need to look at is the one between the link function and the coefficients. For example, for logistic regression, the probability ##p## is related to the covariates ##X## via a sigmoid equation and ##p## and the ##\beta##s are not in a linear relation. But the logit and the ##\beta##s are!
  • OLS is the "best" method to find the unknown coefficients when the model is linear regression (simple or multiple). OLS is also the "best" method when the model is polynomial regression (linear regression being a special case of it).
  • However, in the case of logistic regression, we cannot use OLS to compute the estimated coefficients.. I initially wondered why since the log of the odd is a linear function of the covariates is a straight line model: $$log(odd)=\beta_1 X_1+\beta_2 X_2+...+\beta_0$$
I thought we could use OLS to find the coefficients in the equation for ##log(odd)=log(\frac {p}{1-p})##, given the straight line relation with the ##X## variables, and then, via simple math transformations, find the probability ##p## which is related to the covariates ##X##s via the sigmoid function. I believe the reason we cannot use OLS to find the betas for logistic regression is that the OLS assumptions are violated for logistic regression so the estimated betas would be quite wrong. So we have to resort to the maximum likelihood iterative estimation (MLE) method to find the betas.

Am I on the right track? Any corrections? Thank you!
 
Physics news on Phys.org
  • #2
It depends what you mean by ordinary least squares (OLS). If you just mean minimising the sum of squared errors (SSE), then that still provides a consistent estimator. But we can't just use the closed-form formulas used to give OLS solutions to simple linear regressions, because the estimates ##\hat p_i## are nonlinear functions of the regressors, which violates the assumptions used to derive those formulas. To minimise the SSE we need to use an iterative, non-linear optimiser. Or we can forget about SSE and use MLE instead, which is also a non-closed form, iterative approach.
 
  • Like
Likes fog37
  • #3
The logit model was fitted for a long time via linear regression. The problems are e.g. with points with p=0 or p=1. The variance of log p/(1-p) varies with p, hence unweighted linear regression will not be efficient.
 
  • Like
Likes FactChecker and fog37
  • #4
Good answers above: also:

- if you tried to use LS regression with the original data for a logistic binary classification problem none of the usual inference procedures would be justified since they require a continuous response
- if you tried to use LS regression with a mulinomial classification problem, where you coded the k response levels 1, 2, 3, ..., k, you would be implying an ordering of importance of the levels; and results would be different for different orderings
 

What is the difference between OLS and GLM models?

Ordinary Least Squares (OLS) and Generalized Linear Models (GLM) are both types of regression models used for predicting an outcome. OLS is used specifically for continuous dependent variables with normally distributed errors. It assumes linearity, constant variance, and independence. GLM, on the other hand, extends OLS to accommodate dependent variables that have error distributions other than a normal distribution (like binomial or Poisson), and it uses a link function to establish the relationship between the linear predictor and the mean of the distribution function.

What is a link function in GLM?

A link function in a Generalized Linear Model (GLM) is a function that links the mean of the distribution of the dependent variable to the linear predictor. The link function is used to transform the expected value of the response variable so that the transformed value can be modeled as a linear combination of the predictors. Common examples include the logit link for logistic regression (used with a binomial distribution) and the log link for Poisson regression.

How do you interpret coefficients in a GLM?

In a GLM, coefficients are interpreted as the effect of a one-unit change in the predictor variable on the transformed mean of the response variable, holding other variables constant. The interpretation depends on the link function used. For example, in a logistic regression (with a logit link), coefficients represent the change in the log odds of the outcome per unit change in the predictor. In a Poisson regression (with a log link), coefficients represent the change in the log of the expected count per unit change in the predictor.

Can GLM be used for both classification and regression tasks?

Yes, Generalized Linear Models can be used for both classification and regression tasks. The choice of distribution and link function determines the type of task. For example, using a binomial distribution with a logit link function is suitable for binary classification tasks (logistic regression), while using a normal distribution with an identity link function is suitable for regression tasks (similar to OLS).

What are the assumptions of a GLM?

GLMs have several assumptions, although they are less restrictive than those of OLS. These include the assumption that the response variable Y follows a distribution from the exponential family (e.g., normal, binomial, Poisson), the mean of the distribution can be linked to the linear predictors through a link function, and observations are independent. Unlike OLS, GLMs do not assume homoscedasticity (constant variance) or that the response is normally distributed.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
486
  • Set Theory, Logic, Probability, Statistics
Replies
23
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
30
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
473
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
2K
Back
Top