I'm looking for a different answer to this related question
IMHO, the weight matrix is just the inverse of the covariance of the observations, which can be correlated.
I've been using nls because I'm fitting non-linear models, but taking the diagonal of the covariance matrix removes tons of information.
I also know about MASS::lm.gls that supports a full covariance matrix for linear models (not tested myself).
Anyone could point me to a library that supports full covariance matrix in a non-linear least-squares fit?