12.12 Generalized Linear Models

We can also use stan_glm() to fit models with Binomial, Gamma, inverse Normal, and other data structures. All of these options belong to a larger class of generalized linear models (GLMs).

\[g((\text{E}(Y|...)) = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2} + \cdots + \beta_{p}X_{p}\]

where the appropriate link function \(g\) depends on the data structure.