Implementation of time-varying SLR using OLS estimates
One of the basic assumptions of the general linear model is that the parameters are constant over time. It has been often suggested that this may not be the valid assumption to make. In cross section studies there can be heterogeneity in the parameters across different units, where as in time series studies there can be variation over time in the parameters... paper link
pip install tvslr
from tvslr.tvslr import TVSLR
"""
X:= numpy array containing the independent feature vectors
y:= numpy array containing dependent variable
n:= subset size (must be greater than number of independent features including intercept variable)
"""
reg = TVSLR(X, y, n)
betas = reg.run()
print(betas)
print("R-squared:", reg.cod)
print("Adj. R-squared:", reg.adj_cod)
python -m tvslr <excel filename> <sheetname> <subset size>