Solution
= Solution
When $p>n$, the pooled within-class covariance has rank at most $n-L<p$, so it is singular and ordinary LDA is not defined. For every $\lambda>0$,
$$
\widehat\Sigma_\lambda=\widehat\Sigma+\lambda I
$$
is positive definite because $v^T\widehat\Sigma_\lambda v\geq\lambda\|v\|^2>0$. Replacing the covariance by this matrix gives well-defined regularized LDA. Choose $\lambda$ for predictive performance by <cross-validation>.