Solution (source code)

= Solution

Dividing row $i$ of both $Y$ and $X$ by $\sqrt{v(X_i)}$ transforms the model to one with covariance $\sigma^2I$. Ordinary least squares without an intercept on these transformed data is exactly the estimator in part (a). In R, the unweighted estimator is returned by

``
R
fit2 <- lm(Y ~ X - 1)
fit2$coefficients
``