# Unbiased Estimator for $EX_1EY_1$

Suppose you have a set of i.i.d. variables $X_1,...X_n$ and $Y_1, ..Y_n$. The correlation between $X_i$ and $Y_i$ is $0.5$ for $i = 1,...n$ and $0$ for $X_i$ and $Y_j$ for any $i \neq j$. Provide an unbiased estimator for $\phi = \textbf{E}X_1\textbf{E}Y_1$.

I started testing whether using sample mean give us an unbiased estimator but it does not. So far, since the covariance formula does have an instance of $EX_iEY_i$ I found that encouraging but not sure how to procede from there.

Since $X_i$ and $Y_i$ are dependent, $\mathbb{E}[X_iY_i]\ne\mathbb{E}[X_i]\mathbb{E}[Y_i]$. However, since $X_i$ and $Y_j$ are independent when $j\ne i$, $$\mathbb{E}[X_iY_j]=\mathbb{E}[X_i]\mathbb{E}[Y_j]$$ Therefore $$\frac{1}{n}\sum_{i=1}^n X_i\frac{1}{n-1}\sum_{\stackrel{j=1}{j\ne i}}^n Y_j=\frac{1}{n(n-1)}\sum_{i=1}^n X_i\left\{\sum_{j=1}^n Y_j-Y_i\right\}=\frac{n}{n-1}\bar{X}\bar{Y}-\frac{\sum_{i=1}^n X_iY_i}{n(n-1)}$$ is an unbiased estimator of $\mathbb{E}[X_i]\mathbb{E}[Y_i]$. (Which in addition provides an estimate of the bias of $\bar{X}\bar{Y}$.)

There is a more general solution to this problem.

In a bivariate world, with random variables $(X,Y)$:

$$\text{an unbiased estimator of } \quad \mathbb{E}[X^a Y^b] \; \; \mathbb{E}[X^r Y^t] \quad \text{ is} \quad \frac{s_{a,b} s_{r,t}-s_{a+r,b+t}}{n(n-1)}$$

where $s_{c,d}$ denotes the bivariate power rum $s_{c,d}=\sum _{i=1}^n X_i^c Y_i^d$.

In the OP's case, $a =1$, $b = 0$, $r = 0$ and $t=1$, the solution is thus:

$$\frac{s_{1,0} s_{0,1} - s_{1,1}}{n(n-1)}$$

... which is equal to the solution given by Xi'an.

In the current version of mathStatica, there is a function called PolyRaw that automatically calculates unbiased estimators of products of raw moments, for any dimension.