# GLM in Matrix Notation

I would like to verify my thoughts here concerning matrix notation of generalized linear models (i.e. generalized general linear models). A classical generalized linear model is given by $$Y_i = h(\mathbf x_i'\boldsymbol \beta) + \epsilon_i$$ where $Y_i|\mathbf x_i$ is assumed to follow some distribution from the exponential family, $h$ is a link function and $\epsilon_i$ is an error term with $\mathbb E[\epsilon_i|\mathbf x_i] =0$. (the dependent variable, as well as the error, and the link function may be (row)vector-valued).

The likely most common example of a GLM is the logit model where $Y_i|\mathbf x_i\sim Bernoulli(h(\mu_i))$ and $h(z) = (1+\exp(-z))^{-1}$.

$\\$

Now I want to state the GLM in matrix notation (basically like in the general linear model $\mathbf Y = \mathbf X\boldsymbol\beta + \mathbf U$). My attempt: Stacking the observations from $i=1,\dots n$. Then $$\mathbf Y = \mathbf H(\mathbf X\boldsymbol\beta) + \mathbf U$$ But I wonder: What distribution follows $\mathbf Y|\mathbf X$?

I know that if $Y_i$ is normally distributed then $\mathbf Y$ is also normally distributed since one could just stack all the columns of $\mathbf Y$ to get a new vector whose elements are all normally distributed. But I wonder what happens if $Y_i$ are for instance multinomially distributed? Stacking the columns of $\mathbf Y$ would lead to what distribution? Categorial distribution?

• I wonder too now... but I thought the conditional distribution $Y|X$ followed the distribution of the error (in your case $U$)? In other words that the distribution of the error is assumed to be from the exponential family. Such that $Y|X$, which is known through parameter $H(X\beta)$ (could be, e.g. the mean if mean of $U$ if zero) is distributed that way and so we can solve w.r.t that distribution to find $\hat\beta$... – H. Rev. May 8 '17 at 16:50