/tv-slr

Implementation of time-varying SLR using OLS estimates

Primary LanguagePythonMIT LicenseMIT

tv-slr

Implementation of time-varying SLR using OLS estimates

Idea

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

Installation

pip install tvslr

Usage

In python

    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)

In command prompt

    python -m tvslr <excel filename> <sheetname> <subset size>