# In a GLM, how do the dimensions of the linear predictor and the range of the link function always align?

Let $$\mathbf{\vec y}$$ be the response vector. Then, we can write the exponential family as : $$\large p(y;\boldsymbol{\eta})=h(y) \exp \left(\boldsymbol{\eta} \cdot \mathbf{T}(y)-A(\boldsymbol{\eta})\right)$$ In the context of GLMs, $$\boldsymbol{\eta}$$ is both the natural parameter and the linear predictor given as : $$\boldsymbol{\eta} =\mathbf{\vec w} \cdot \mathbf{X}$$ Where $$\mathbf{\vec w}$$ is the weight vector and $$\mathbf{X}$$ is the feature matrix.

We then write the hypothesis of the GLM as : $$\large \mathbf{h}_{\mathbf{\vec w}}(\mathbf{X}) = \mathbf{g}^{-1}(\boldsymbol{\eta})$$ Where $$\mathbf{g}^{-1}$$ is the inverse of link function called the mean function.

Now consider gamma regression, $$\boldsymbol{\eta}$$ is given as :

$$\boldsymbol{\eta} = \begin{bmatrix} \eta _{1} \\ \eta _{2} \end{bmatrix} = \begin{bmatrix} \alpha - 1 \\ -\beta \end{bmatrix}$$

Here, $$\boldsymbol{\eta} \in \mathbb{R}^{2}$$ and if we are considering $$m$$ training examples and $$n$$ features, then $$\mathbf{\vec w} \cdot \mathbf{X} \in \mathbb{R}^{m}$$ . Clearly, $$\boldsymbol{\eta}$$ and $$\mathbf{\vec w} \cdot \mathbf{X}$$ are not compatible and cannot be set equal. Moreover, according to Wikipedia, the hypothesis of gamma regression is given as : $$\mathbf{h}_{\mathbf{\vec w}}(\mathbf{X}) = -\frac{1}{\mathbf{\vec w} \cdot \mathbf{X}}$$

My question is this : how do we know that the dimensions of $$\boldsymbol{\eta}$$ and $$\mathbf{\vec w} \cdot \mathbf{X}$$ are compatible?

Follow-up question : how is the hypothesis of gamma regression derived if we cannot set $$\boldsymbol{\eta}$$ equal to $$\mathbf{\vec w} \cdot \mathbf{X}$$ ?

The issue is the exact definition of gamma regression. The hypothesis of gamma regression is derived from the gamma distribution with a redundant scale parameter $$\alpha$$ . What this means is that we don't consider $$\alpha$$ when equating the linear predictor to $$\mathbf{\vec w} \cdot \mathbf X$$ .
More precisely, we set $$\alpha = 1$$ , which gives us $$\eta_1 = 0$$ . By definition, we set $$\eta_2 = \mathbf{\vec w} \cdot \mathbf X$$ .
This gives : $$\mathbf{\vec w} \cdot \mathbf X = - \beta \\ \Rightarrow \frac{1}{\beta} = - \frac{1}{\mathbf{\vec w} \cdot \mathbf X}$$ Also note that the mean of the gramma distribution is $$\frac{\alpha}{\beta}$$ . And since $$\alpha = 1$$ , the mean is equal to $$\frac{1}{\beta}$$ . Thus, we can write : $$\mu = - \frac{1}{\mathbf{\vec w} \cdot \mathbf X} = \mathbf{h}_{\mathbf{\vec w}}(\mathbf{X})$$ This is how the gamma regression hypothesis is derived. A similar process is followed when deriving the hypothesis of linear regression from the normal distribtuion, where we set the standard deviation to 1.
• With gamlss models you can have gamma regressio with separate linear predictors for mean and variance rdrr.io/cran/gamlss.dist/man/GA.html Commented Jan 28 at 16:59