There are cases where the traditional, fixed effect linear model (essentially [[Linear Regression Methods]]) do not satisfy modeling needs.
> [!examples]
> Consider an experiment where six students were randomly assigned to two different study plans (treatments level $0,1$) $X$. Their scores on $4$ exams after the study plans are the response $Y$.
> To account for their different starting points, we model their specs as $Z$ (one-hot encoded).
>
> Naive modeling with fixed effects yields the model $Y=X\beta+Zb+\epsilon, ~\epsilon \sim N(0, \sigma^{2}_{\epsilon}),$and the six students' scores are $\mathrm{iid.}$ instances of $Y$.
>
> However, it has the following issues:
> - (1) Because by design $X$ is nested inside $Z$, this causes perfect collinearity.
> - (2) $Z$ completely confounds the effect of $X$ -- we are interested in estimating $\beta$, but not $b$ (which will not generalize beyond the 6 test subjects).
This motivates the **mixed model**, where we model $b$ as **random effects**: $b_{1:q} \sim N(\mathbf{0}, \Sigma), ~\pmb{\epsilon}_{1:n} \sim N(\mathbf{0}, \Lambda), ~b \perp \pmb{\epsilon},$where subscripts indicate vector dimensions, and $q=6$ in the example above; $n=4\times 6$ is the total number of exams taken by those $6$ students.
This is because *we only care about the random effect's variance $\Sigma$ relative to effect $\beta