Y_i are independent random variables following a normal law of mean m_i = Ax_i + B and variance V.  

Let's take a sample y_i ~ Y_i.

I determine a and b, the weigthed least squares coefficients with weights w_i of sum 1. I am interested in an unbiased estimator of variance V.

sum w_i (y_i - a x_i - b)²

is obviously biased but I don't manage to get anywhere close to a simple expression. (In the case of the constant fit, it's fairly easier,see [https://mathoverflow.net/questions/11803/unbiased-estimate-of-the-variance-of-a-weighted-mean][1].)

Any ideas or references?


  [1]: https://mathoverflow.net/questions/11803/unbiased-estimate-of-the-variance-of-a-weighted-mean