# Generalized linear modelling

A model is a mathematical description of a system or a real-life scenario. If you are undertaking any mathematics-related course, you will definitely learn how to model. The simplest of the modelling that you will learn is linear regression which assumes the linearity of the dataset. It has its own assumptions and advantages. In addition, you would learn about generalized linear modelling. However, generalized linear modelling requires you to have prior knowledge of linear regression and normal distribution. Generalized linear modelling serves as a good starting point for advanced mathematical modelling. It’s not as complicated as you might think of it to be. Like the linear regression, let’s try to understand more about its assumptions, advantages and other pertinent facts.

##### What is generalized linear modelling?

The ordinary least square is a method of estimating the parameters of a simple or multiple linear regression model. In a linear regression model, it’s assumed that a unit increase in the independent variables causes a similar increase in the dependent variables. Linear regressionholds when certain assumptions are adhered to. One of the assumptions behind this modelling is that the datasets should be normally distributed.

At times the linear regression model might seem inappropriate. Let’s take the case of a linear regression model which has learned that a 10 degrees Celsius increase in temperature will lead to a decrease in the number of people visiting a beach by 500. This might be unrealistic for a beach that receives only 50 people. You will predict an impossible number with a 10 degrees Celsius rise in temperature. A better model that would suit this scenario is one which predicts that with a 10 degrees Celsius increase in temperature, the attendees to the beach will double while a similar drop in temperature will halve the beachgoers.

A glm model is a generalization of ols models that allows for the response variable that has error distributions. They were developed as a model that would unify other statistical models such as logistic regression, linear regression, and poison regression.

##### Components of a glm

The generalized linear model has three components. These are:-

##### The random component.

The random component is the probability distribution function of the response variable (dependent variable). Sometimes it’s referred to as the error model or noise.

##### Systematic component

It specifies both the explanatory variable and the independent variable.

The link function specifies how the link between the aforementioned components function. It states how the independent variable associates with the linear predictor of the independent variable.

To understand the above components of a generalized linear model, let’s take the can example and identify these components.

##### Binary logistic regression

It models how the categorical dependent variables depend on a set of independent variables. For this regression model, the response variable is the binomial distribution, while the systematic components are the independent variables. They are either discrete or continuous. In either way, they have to be linear. The link function refers to the logistic regression.

##### Assumptions of generalized linear model.
1. The response variables are independently distributed.
2. The explanatory variables need not be normally distributed but should take the form of the exponential families.
3. It does not assume there is linearity between the independent and dependent variable.
4. The assumptions of equal variance do not need to be satisfied.
5. The errors are independently distributed and not normally distributed.