Weighted Least Squares with Endogenous Weights Suppose I estimate the model
$$y_i=\beta_0+\beta_1 x_i +\epsilon_i$$
via weighted least squares where $x_i$ and $\epsilon_i$ are independent, but I use weights $w_i$ that may be correlated with both $x_i$ and $\epsilon_i$.  Is $\hat\beta_1$ still unbiased? I am having trouble trying to prove/disprove this.  
The bias takes the form 
$$ \frac{\sum_i w_{i}\left(x_{i}-\bar{x}\right)\left(\epsilon_{i}-\bar{\epsilon}\right)}{\sum_i w_{i}\left(x_{i}-\bar{x}\right)^{2}}
$$
where $\bar x,\bar \epsilon$ are the weighted averages of $x,\epsilon$, but have not made any more progress.
Thanks!
Edit: I guess you can recast this as the OLS
$$\sqrt{w_i}y_i=\beta_0\sqrt{w_i}+\beta_1\sqrt{w_i}x_i+\sqrt{w_i}\epsilon_i$$
and the question becomes what is the relationship between $\sqrt{w_i}x_i$ and $\sqrt{w_i}\epsilon_i$?
 A: No, your coefficient estimators are not necessarily unbiased: Since you have specified that the weights may be correlated with the error terms, this means that they are random variables in your analysis.  By allowing the weights to be related to the error terms, this allows models in which data points may be given high/low weighting based on the error term, conditional on the explanatory variable.  This allows for the creation of biased estimators by favouring data points that have certain error properties that cause a higher/lower coefficient estimate.
To see this, let's consider a special case where $W_i \in \{ 0,1 \}$ so that the weights are either zero or one.  This is tantamount to using OLS estimation, but with only a subset of the data points, where that subset can depend on both the explanatory variable $x_i$ and the error term $\epsilon_i$.  Clearly, using this combination of values, it is easy for us to specify a model where we only include data points that over-estimate the coefficients.  For example, we could take $W_i = \mathbb{I}(\text{sgn} (\epsilon_i) = \text{sgn}(x_i - \bar{x}))$, yielding correlation between the weights and the errors/explanatory variables.  In this case the coefficient estimator is an OLS estimator, except that it only uses data points that have positive error when $x_i > \bar{x}$ and negative error when $x_i > \bar{x}$.  This would clearly lead to systematic overestimation of the slope coefficient.

To get a better understanding of what is going on here, it is worth deriving an explicit equation for the bias of the WLS estimator.  Letting $W$ be the weight matrix containing the weights of interest, we have:
$$\begin{equation} \begin{aligned}
\text{Bias}[\hat{\beta}_W] = \mathbb{E}[\hat{\beta}_W] - \beta 
&= \mathbb{E}[ (x^\text{T} W x)^{-1} (x^\text{T} W Y) ] - \beta \\[6pt]
&= \mathbb{E}[ (x^\text{T} W x)^{-1} x^\text{T} W \epsilon] \\[6pt]
&= \mathbb{Cov}[ (x^\text{T} W x)^{-1} x^\text{T} W, \epsilon].
\end{aligned} \end{equation}$$
In the standard case where $W \bot \epsilon$ this reduces to zero (i.e., unbiasedness), but in the case where these can be correlated, you can have bias.
A: When the mean model is correct, then the least squares estimator is still unbiased for any arbitrary weighting mechanism. The consequence of using the wrong weights is that the ordinary least squares is inefficient. To prove WLS is unbiased you merely need to show that:
$$\begin{eqnarray}
E(\hat{\beta_W}) &=& E(\left(\mathbf{X}\mathbf{W} \mathbf{X} \right)^{-1}  \mathbf{X}\mathbf{W} Y  \\
&=& \left(\mathbf{X}\mathbf{W} \mathbf{X} \right)^{-1} \mathbf{X}\mathbf{W} E(Y)  \\
&=& \left(\mathbf{X}\mathbf{W} \mathbf{X} \right)^{-1}  \mathbf{X}\mathbf{W} \mathbf{X} \beta  \\
&=& \beta\\
\end{eqnarray}$$
