I'd like to modify the answer to this question to allow weighted observations. I think all I need to do is weight the inputs X and Y.
X = w * X
Y = w * Y
the other parts of the procedure should follow. Please correct me if I am wrong.
I'd like to modify the answer to this question to allow weighted observations. I think all I need to do is weight the inputs X and Y.
X = w * X
Y = w * Y
the other parts of the procedure should follow. Please correct me if I am wrong.
Weights per the theory of Generalized Least-Square should be constructed as relating to an empirically estimated or theoretical based model of the distribution of error terms.
Most often applied when the absolute magnitude of the error terms are assumed, for example, to be related to the size of the predictor (also called independent) variable. In such a case, transforming both Y and X by dividing by the square root of X will make the error term distribution 'homogeneous', which is an underlying assumption of standard least squares theory. Note, all predictor variables are divided by the square root of the size variable(Xi) so the intercept term, which has always a value of 1, is now not constant, but has a value for the ith term of 1/sqrt(Xi). As a result, the transformed model no longer has an intercept term.
Constrainted least-squares can be mechanically performed by solving the min of the sum of squares of the actual minus fitted subject to a linear constraint (technique of lagrange multipliers). The nature of statistical estimation of the standard deviation of such computed regression coefficients is complex, perhaps Baynesian regression theory or just run your own simulations.
EDIT: In practice I have used Box-Cox Analysis of Transformations as a guide to suggest the proper transformation to employ. The latter is best applied by a random sampling of the dataset, and the gathering of a range of suggested transformations. Linking the transformation to the suspected mechanism/error distribution linked to the nature of the data, for example, survival data, is also advised.