# GLM

The generalized linear model (GLM) is a flexible generalization of ordinary least squares regression. The GLM generalizes linear regression by allowing the linear model to be related to the response variable (i.e. $$Y$$) via a link function (i.e. $$g(.)$$)and by allowing the magnitude of the variance of each measurement to be a function of its predicted value.

The GLM is described as follow: $Y = \mu + \epsilon$ And $E\left[Y\right]=\mu=g^{-1}(X\beta) = g^{-1}(\eta)$ Where:

• $$\epsilon$$ is the residuals or deviation from the mean
• $$g(.)$$ is the link function
• $$g^{-1}(.)$$ is the inverse-link function
• $$g^{-1}(.)$$ is the inverse link function
• $$X$$ is the independent variables or the exogenous factors
• $$\beta$$ is a parameter vector
• $$\eta$$ is the linear predictor: the quantity which incorporates the information about the independent variables into the model. $\eta=X\beta$
Remarks
1. Each outcome of the dependent variables,Y, is assumed to be generated from a particular distribution in the exponential family, a large range of probability distributions that includes the normal, binomial and Poisson distributions, among others.
2. The distribution mean of the $$Y$$ variable (i.e. $$\mu$$ depends solely on the independent variables, $$X$$. $E\left[Y\right]=\mu=g^{-1}(X\beta)$
3. The conditional variance of the dependent variable, Y, is constant: $V(Y\|{X\beta})=\phi \times V({X\beta})$ $$Where:$$
• $$V(.)$$ is the variance function.
• $$\phi$$ is the dispersion factor (constant value).
Normal Identity $$X\beta=\mu$$
Binomial Logit $$X\beta = \ln\frac{\mu}{1-\mu}$$
Poisson Log $$X\beta = \ln\mu$$