I have 2 classes that both follow multivariable normal distribution, the first with $$\mu_1 = [-1,-1], \Sigma_1=\begin{bmatrix}0.4&0\\0&0.4\end{bmatrix} $$ and the second with $$\mu_2=[1,1],\Sigma_2=\begin{bmatrix}0.4&0\\0&0.4\end{bmatrix}$$
Im trying to program in python a linear classifier using Fisher's LDA. So first step was to calculate the "within classes variance matrix" $S_W$. This quantity is "officialy" defined, in my case, as $$S_W = \sum_{i=1}^2\sum_{n=1}^N(x_n^i - \mu_i)(x_n^i - \mu_i)^T$$
My first question is, can this matrix be written also as $S_W = \Sigma_1 + \Sigma_2$? I thought it was possible to do it, but after programming the computation of $S_W$ using the first formula, it doesn't yield the same result with the second formula, which uses the covariance matrices. So the 2 expressions arent equivalent. If this is true, are there any special cases where these 2 are equivalent?
Am I missing something? Thanks in advance!