Pages

Wednesday, August 10, 2016

OLS in Python

There are a few ways to perform Linear Regression(OLS) in Python.


Here is a short list of them:


1: > pandas.ols(y, x)
2: > pandas.stats.api.ols(y ,x)
3: > scipy.stats.linregress(x, y)
4: > import statsmodels.formula.api as smf
    > results = smf.ols('Close ~ Open + Volume', data = df) # df is a DataFrame



No comments:

Post a Comment