'Can you add weightings to values for linear regression?

I'm trying to develop a predictive model that uses previously collected data to estimate a future value. The data in question is taken from measurements made over several days, however the more recently collected data is more likely to be an accurate estimate of the next value than older data. I was wondering if there was a way to add 'weightings' to values, such that the more recently collected data has a greater impact on the line of best fit in comparison to older data?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source