i'm trying to apply weights for a linear regression and i was wondering how should i go about this, should i use one of the variables as weights or std of all variables or etc. i've been looking for information about this on net but there is surprisingly very little information is available on the matter.

should i try to construct weights by analyzing different variables? is there a set in stone approach to this? what are some best practices for this?

  • 1
    $\begingroup$ Weights are often used to account for uncertainty in the data values, for example if a given data point's value is very uncertain then the weight for that data point is small. $\endgroup$ – James Phillips Jul 26 '18 at 17:36

There are plenty of sites to help with this sort of question, but I will highlight a few.

To have a better understanding of "what is weighted least squares?", this link will help. It has a high-level overview of the method, as well as a pros-and-cons list to the method. It also goes over weighting schemes, which answers the question you stated.

For a mathematical basis of the answer to your question, see this thread, which describes the method used in most algorithms.

This link will show you some in-depth examples of how to implement Weighted OLS. Both examples and code are given along with the explanation.

If you are interested in Recency-weighted regressions (as to be used in time series), take a look at this article, which gives a nice overview of the method with a baseball analogy, where observations are highly autocorrelated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.