Allow option for generalized least squares (i.e. instead of ||r(x)||^2, have ||r(x)||_A^2, where A is the inverse of the correlation matrix; see https://un5qgjbzw9dxcq3ecfxberhh.julianrbryant.com/wiki/Generalized_least_squares). This captures correlation/heteroskedacity in the residuals.