I'm trying to calculate the weighted co-variance by hand to better understand what is going on. I have read the Wikipeida article and I understand the concept. However, when plugging in numerical values I encounter the following problem:
For example assume I have three observations as given in matrix A
$A = \left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right]$
each row vector of matrix A has a weight value associated with it as $w_i = (0.5, 0.33, 0.17) $
Using the equation in Wikipedia which is:
$$ q_{jk} = \frac{\sum_{i = 1}^{N} w_i}{(\sum_{i = 1}^{N} w_i)^2 - \sum_{i = 1}^{N} w_{i}^2} \sum_{i = 1}^{N} w_i (x_{ij} - \bar{x}_j)(x_{ik} - \bar{x}_k) $$
if I'm to calculate $q_{21}$ the derivation would look like the following
$$q_{21} = \left[ \frac{1}{1 - (0.25 + 0.1089 + 0.0289 )} \right]\left(w_i(1-0.5)(0 - 0.3) + w_i(0-0.5)(1 - 0.3) + w_i(0-0.5)(0 - 0.3)\right) $$
what should I plug in to $w_i$ ?
Is the other parts of the substitution correctly done?