However, if you happen to know that the data points are NOT IID (independent and identically distributed) and know their covariance, you can come up with a much better estimate of the mean:
where invCov is the inverse of Cov, and [Cov_ij] is a block matrix describing the covariance of data point x_i and x_j.
Here's a dramatic example you can try: draw 100 iid data points from a zero mean gaussian distribution. Assume that the correlation of data point x_i with point x_j is C_ij. Now add a constant (here, I use 3). Compute the mean assuming the data points are IID:
>> mean(data)
ans =
1.8457
Not very close to 3. Now use the above formula:
>> sum(inv(C)*data) / sum(sum(inv(C)))
ans =
3.0617
Much better.