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

In summary, the document discusses the relationship between Ordinary Least Squares (OLS) and Generalized Linear Models (GLM), emphasizing the importance of the link function in GLMs. It explains how link functions connect the linear predictor to the mean of the response variable, allowing for the modeling of various types of data distributions. Additionally, the document examines the interpretation of coefficients in both OLS and GLM frameworks, highlighting the differences in their applications and implications for statistical analysis.
  • #1
fog37
1,569
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
 

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

What is the main difference between OLS and GLM models?

Ordinary Least Squares (OLS) is a linear regression method used for predicting a continuous dependent variable by minimizing the sum of the squared differences between observed and predicted values. Generalized Linear Models (GLM), on the other hand, extend linear models to accommodate non-normal error distributions and link functions, allowing for modeling of various types of dependent variables such as binary, count, and categorical outcomes.

What is a link function in the context of GLM?

A link function is a mathematical function that connects the linear predictor (a combination of the model's parameters and independent variables) to the mean of the dependent variable's distribution. It allows the GLM to model non-linear relationships and different types of response variables. Common link functions include the logit function for binary outcomes, the log function for count data, and the identity function for continuous data.

How do you interpret coefficients in OLS and GLM models?

In OLS models, coefficients represent the average change in the dependent variable for a one-unit change in the predictor variable, holding other variables constant. In GLM models, the interpretation of coefficients depends on the link function used. For example, in a logistic regression (a type of GLM with a logit link), the coefficients represent the log odds of the dependent variable occurring for a one-unit change in the predictor variable.

When should you use OLS over GLM, and vice versa?

OLS should be used when the dependent variable is continuous and normally distributed, and when the relationship between the predictors and the dependent variable is linear. GLM should be used when the dependent variable does not meet these criteria, such as when it is binary, count-based, or categorical, and when the error distribution is not normal. GLMs are more flexible and can handle a wider range of data structures and distributions.

What are some common types of GLM models and their applications?

Common types of GLM models include logistic regression for binary outcomes (e.g., predicting whether a customer will purchase a product), Poisson regression for count data (e.g., modeling the number of times an event occurs), and multinomial logistic regression for categorical outcomes with more than two categories (e.g., predicting the type of transportation a person will choose). Each type of GLM is tailored to handle specific types of data and research questions.

Back
Top