Two-dimensional distribution and related variance computation I have a simple statistical question (forgive me if I use statistical terminology in a wrong way)
Suppose I have a random vector with two components, $(x_1, x_2)$, where $x_1$ can take values from $1$ to $n$ and $x_2$ can take values from $1$ to $m$ 
and I have a two-dimensional distribution $P$ as a $n \times m$ matrix $(i, j)$-th element of $P$ is the probability to observe $(i, j)$ sequence.
Now, I have observations $x^{(k)}_1, x^{(k)}_2$ and can estimate $\widehat{P}$ from the observations (as statistical frequencies)). Now an interesting part. I have a (fixed) vector $v$ and I need to estimate, how well the matrix-by-vector product of $\widehat{P}$ by $v$ is estimated:
$$ E || (P - \widehat{P})v ||^2 = ?$$
 A: I'm going to relabel the number of observations as $T$. 
Let $Y_{i,j}^{(t)}=\chi(x_1^{(t)}=i \wedge x_2^{(t)}=j)$ be the indicator function for the event that the $t^{\mathrm{th}}$ observation is $\{ x_1=i\} \cap \{x_2=j\}$. That is, for all $t$, $\Pr(Y_{i,j}^{(t)}=1)=P_{i,j}$. Let $S_{i,j} = \sum_t Y_{i,j}^{(t)}$. Note that $\mathbb{E}\left[S_{i,j}\right] = TP_{i,j}.$
We can now write:
$\quad T^2 \mathbb{E} || (\widehat{P} - P)v ||^2$
$=\sum_i \mathbb{E} \left[ \left(\sum_j (S_{i,j} - TP_{i,j}) v_j \right)^2 \right]$ 
$= \sum_i \sum_j v_j^2 \mathbb{E}\left[(S_{i,j} - TP_{i,j})^2\right] + 2 \sum_i \sum_{j \not= k} v_j v_k \mathbb{E}\left[( S_{i,j} - TP_{i,j}) (S_{i,k} - TP_{i,k})\right]$
$= \sum_i \sum_j v_j^2 \mathrm{Var}\left(S_{i,j}\right) + 2 \sum_i \sum_{j \not= k} v_j v_k \mathrm{Cov}\left( S_{i,j}, S_{i,k}\right).$
Recognizing that the $S_{i,j}$ variables are jointly multinomially distributed, we obtain
$$T \mathbb{E} || (\widehat{P} - P)v ||^2 = \sum_i \sum_j v_j^2 \left[P_{i,j}(1- P_{i,j})\right] - 2 \sum_i \sum_{j \not= k} v_j v_k \left( P_{i,j}\cdot P_{i,k}\right).$$
A: Since $m$ and $n$ are pretty large, I'd say it is reasonable to consider the entries $\widehat {P_{i,j}}$ as independent $\text{Binomial}(K, P_{i,j})$ variables, divided by $K$. The expectation you're looking at then becomes:
$$\sum_i \mathbb{E} \left(\sum_j (\widehat{P_{i,j}} - P_{i,j}) v_j \right)^2 =
\sum_i \sum_j v_j^2 \mathbb{E}(\widehat{P_{i,j}} - P_{i,j})^2 + \sum_i \sum_{j \not= k} v_j v_k (\mathbb{E} \widehat{P_{i,j}} - P_{i,j}) (\mathbb{E} \widehat{P_{i,k}} - P_{i,k}).$$
Since $\widehat{P_{i,j}}$ is an unbiased estimator of $P_{i,j}$, the last sum is zero, so we are left with the first sum on the right hand side. If $X \tilde\ \text{Binomial}(K, P_{i,j})$, then
$$\mathbb{E}(\widehat{P_{i,j}} - P_{i,j})^2 = \mathbb{E}\left(\frac{X}{K} - P_{i,j}\right)^2 = \frac{\mathbb{E} X^2}{K^2} - 2 \frac{P_{i,j} \mathbb{E}X}{K} + P_{i,j}^2 = \frac{P_{i,j}(K P_{i,j} + 1 - P_{i,j})}{K} - 2 P_{i,j}^2 + P_{i,j}^2 = \frac{P_{i,j}(1 - P_{i,j})}{K}.$$
Substituting this into the first formula, we obtain this result:
$$\mathbb{E}\ \left\Vert (P - \widehat P) v \right\Vert^2 = \frac{\sum_j v_j^2 \sum_i P_{i,j}(1 - P_{i,j})}{K}.$$
